From | Richard Williams <[email protected]> |
To | [email protected] |
Subject | Re: repost: -cond()- function |
Date | Thu, 01 Jan 2004 10:24:14 -0500 |
At 08:59 AM 1/1/2004 -0500, VISINTAINER PAUL wrote:
I have an integer variable that I would like to collapse into a dichotomous variable. Using the following statement:Well, if it is any consolation, it looks to me like you are doing it exactly right. In fact, I just tried it with some data I made up using your exact syntax, and gen cholcat = cond(chol,0,1,9) worked fine.
.gen cholcat = cond(chol,0,1,9)
produces the same output as:
.gen cholcat = cond(chol,0,1)
The first statement continues to recode "missings" as 1, not 9. In order to capture the missings appropriately, I have to follow each -cond()- statement with a -replace- command.
Am I using the -cond()- function appropriately?
© Copyright 1996–2024 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |