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

repost: -cond()- function


From   "VISINTAINER PAUL" <[email protected]>
To   <[email protected]>
Subject   repost: -cond()- function
Date   Thu, 1 Jan 2004 08:59:32 -0500

I am reposting this message:
 
 
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

*
*   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/



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