| |
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Dropping Subset of Variables
use NFHS98_school
drop hvidx_02-hvidx_46
forvalues x= 101/117 {
drop hv`x'_02-hv`x'_46
}
Sergiy
----- Original Message -----
From: "Michael Blasnik" <[email protected]>
To: <[email protected]>
Sent: Thursday, March 29, 2007 2:38 PM
Subject: Re: st: Dropping Subset of Variables
The forvalues command is specified incorrectly. You will also want to
change the max value to 46 and have the loop start at 2, not 1
forvalues x= 2/46 {
drop hvidx_0`x'
}
You will also want to have more drop lines to list the other variable
stubs you want dropped. but only you know the full pattern of variable
names that you want to be dropped...
Michael Blasnik
----- Original Message -----
From: "Gauri Khanna" <[email protected]>
To: <[email protected]>
Sent: Thursday, March 29, 2007 8:18 AM
Subject: Re: st: Dropping Subset of Variables
Dear Neil,
I tried out the command but I get an error of invalid syntax
forval x in 1/6{
2. drop hvidx_0`x'
3. }
invalid syntax
r(198);
*
* 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/
*
* 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/