Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Creating variable in Stata


From   "Shellenberg, Kristen" <kshellen@jhsph.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: Creating variable in Stata
Date   Fri, 19 Mar 2010 14:11:27 -0400

Hello Stata-listers,

I'd like to create a variable that indicates whether several variables in the dataset (77 actually) are all coded as missing (.) for a respondent.  I've tried the following with no luck... 

gen info_C=0
replace info_C=1 if variable4/variable81==.

and 

gen info_C=0
replace info_C=1 if variable4-variable81==.

Can anyone tell me how to generate a variable that will tell me if a whole set of variables were coded as missing without writing out replace info_C=1 if variable1==.& variable2==. and so on for all 77 variables?

Thank you!

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


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