Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: capture drop issue

From   A Loumiotis <>
Subject   st: capture drop issue
Date   Wed, 7 Jul 2010 10:42:42 +0300


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:

set obs 10
gen obs=_n
gen obs2=2*obs
gen var1=runiform()
gen var2=rnormal()
gen var3=var1*var2
drop obs2
capture drop obs2 var1-var3

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
Is there an easy fix?
Antonis Loumiotis
*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index