[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

From |
"Visintainer, Paul" <PAUL_VISINTAINER@NYMC.EDU> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
st: question on cond( ) |

Date |
Thu, 28 Feb 2008 11:58:00 -0500 |

I'm not sure why the "condition" function is not coding z with 2 missing values. If I'm reading the functions command correctly, z should be coded as missing: cond(a>2,"this","that","missing") = "missing" if a > . cond(a>2,"this","that","missing") = "this" if a > 2 and a < . Any ideas? Thanks. . gen z=cond(x>5,1,0,.) . list +-------+ | x z | |-------| 1. | 1 0 | 2. | 2 0 | 3. | 3 0 | 4. | 4 0 | 5. | 5 0 | |-------| 6. | 6 1 | 7. | 7 1 | 8. | 8 1 | 9. | . 1 | 10. | . 1 | +-------+ ______________________________________ Paul F. Visintainer, PhD * * For searches and help try: * http://www.stata.com/support/faqs/res/findit.html * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**Re: st: question on cond( )***From:*Nick Winter <nwinter@virginia.edu>

- Prev by Date:
**st: RE: How to put a prefix on a categorical variable that still carries label values?** - Next by Date:
**Re: st: conditional likelihood ratio test when the cluster option is used in ivreg (weak instrument).** - Previous by thread:
**st: How to put a prefix on a categorical variable that still carries label values?** - Next by thread:
**Re: st: question on cond( )** - Index(es):

© Copyright 1996–2016 StataCorp LP | Terms of use | Privacy | Contact us | What's new | Site index |