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: Thread-Index: AcsBvuIZsv48hZwTRSGxCrT1fAtTUQ==
From
"Wald,Kenneth D" <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: Thread-Index: AcsBvuIZsv48hZwTRSGxCrT1fAtTUQ==
Date
Tue, 1 Jun 2010 15:16:05 -0400
Simple as it seems, I'm having a problem understanding how to assign missing values to a Stata dataset that did not have any missing values designated when it was created. I've gone through the FAQs and documentation but most of it seems to apply to cases where a missing value was designated during data input, not my situation.
The variable "q50h" has legitimate values of 1-10 and values of 0 and 11 for cases that I want to consider missing. The simplest way I've found to do this is by this command:
replace q50h=. if (q50h==0)|(q50h==11)
This works but I have the feeling there should be a more efficient way to do this for a large number of variables. I know I could simplify a bit by placing "q50h>=1 & q50h<=10" after the "if" but that's not much more efficient.
Thanks for any advice.
Kenneth D. Wald
University of Florida
Kenneth D. Wald
Distinguished Professor of Political Science
University of Florida
POB 117325
Gainesville, FL 32611-7325
Phone: 352-273-2391
Fax: 352-392-8127
Home Page: www.clas.ufl.edu/users/kenwald
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/