Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: capture drop issue
From
A Loumiotis <[email protected]>
To
[email protected]
Subject
st: capture drop issue
Date
Wed, 7 Jul 2010 10:42:42 +0300
Hi,
I face the following problem with capture drop varlist.
If one of the variables in the varlist does not exist, capture drop
does not drop the rest of the variables in the varlist.
I use Stata 11.
Here is an example:
******
clear
set obs 10
gen obs=_n
gen obs2=2*obs
gen var1=runiform()
gen var2=rnormal()
gen var3=var1*var2
list
drop obs2
capture drop obs2 var1-var3
list
*****
I would like my capture drop call to drop var1-var3 but because obs2
is already dropped for some reason capture drop does not drop
var1-var3.
Is there an easy fix?
Thanks,
Antonis Loumiotis
*
* 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/