Hello, all.
I have generally used SAS for data manipulation, so I am not familiar with the best way to code the equivalent of the subsetting "else if" statement in STATA.
This SAS code defines RACEETH hierarchically, based on the value of HISPANG and RACEG. It only permits RACEETH to change once (from default missing to a valid value), at the first occurrence of a true IF statement:
if hispang = 0 then do;
if raceg = 1 then raceeth = 1;
else if raceg = 2 then raceeth = 2;
else raceeth = 3;
end;
else if hispang = 9 then raceeth = .N;
else if hispang ge 1 and hispang < 9 then raceeth = 7;
How do I accomplish this in STATA?
Your insights are appreciated,
Deb Garvey
******************************
Deborah Garvey, Ph.D.
Department of Economics
Kenna Hall
Santa Clara University
Santa Clara, CA 95053
408/554-5580
408/554-2331 (FAX)
[email protected]
http://lsb.scu.edu/~dgarvey
**********************************
*
* 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/