I have a large dataset with a lot of variables. I am trying to get rid of a
subset of the variables subject to a IF condition. I thought of doing this
in a loop such as the following:
foreach var of varlist soils*{
sum `var'
drop `var' if r(mean)==0
}
However, the above doesn't work because stata doesn't like line 3. Is there
a way around this or another way to get rid of particular variables subject
to an IF condition?
Thanks
Pradeep
*
* 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/