Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Cannot generate a dummy variable using if command
From
Joseph Kwan <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: Cannot generate a dummy variable using if command
Date
Fri, 2 Aug 2013 18:05:09 +0000
I would like to generate a variable for people older than 25 years old,
so I use
gen old=1 if age>25
but then Stata returns with an old dummy variable with all 1 for all observations.
I checked the syntax and I do not know what is wrong.
Is Stata known to have faults like that?
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/