Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Dropping variables

From   "Pradeep Kurukulasuriya" <>
To   <>
Subject   st: Dropping variables
Date   Wed, 3 Nov 2004 22:42:17 -0500

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?


*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index