Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: -cond()- function


From   "VISINTAINER PAUL" <PAUL_VISINTAINER@nymc.edu>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: -cond()- function
Date   Wed, 31 Dec 2003 15:06:28 -0500

I have an integer variable that I would like to collapse into a dichotomous variable. Using the following statement:
 
      .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?
 
Thanks,
 
paul visintainer

<<winmail.dat>>




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