Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Nick Cox <njcoxstata@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: Dropping variables in USE statement |
Date | Thu, 28 Mar 2013 14:19:37 +0000 |
You can specify a -varlist- with the -use- command, which is the way to do what you want. This is documented in the -help- for -use-. But you do that positively, not negatively. -drop- in Stata terminology refers only to deletion of variables from the current dataset, that in memory. It would never be used to refer to something else, namely not reading in some variables. There is no difficulty about using a wildcard * with -drop- once data are in memory. There is an explicit example in the -help- for -drop-. Nick On Thu, Mar 28, 2013 at 1:56 PM, William Sankey <wsankey@gmail.com> wrote: > Is there a way to drop variables on the use statement? I am bringing > in Stata dataset with too many variables (transferred over from SAS > which is a pain to drop variables because I don't think I can drop > variables with a *). > > Ideally I would like to process use DATASET, drop D4* D5* D6* etc > > Anyway to approach this besides going back to the original dataset in SAS? > * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/