This problem is no problem. Loop over
your varlist instead:
gen byte logical = 1
quietly foreach v of var <varlist> {
replace logical = 0 if `v' < .
}
Nick
[email protected]
Timothy Mak
This is ok if my variables are a100, a101, a102, and so on, but it
wouldn't work if I have say a101a, a102a, a102b, a103_oth, and so on,
variables that have the same root but don't have other things in common...
But thanks anyway.
Dominic Muston
I'm not sure this is shorter!
gen logical==1
forvalues i=100(1)200 {
replace logical = 0 if a`i'!=.
}
list if logical==1
*
* 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/