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]

Re: st: Dropping variables in USE statement

From   Maarten Buis <>
Subject   Re: st: Dropping variables in USE statement
Date   Thu, 28 Mar 2013 15:26:57 +0100

On Thu, Mar 28, 2013 at 2:56 PM, William Sankey 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 *).

There is no need to guess. If you look at the help-file of -drop- it
tells you that it takes a varlist, so you can type something like
-drop D4* D5*-

> Ideally I would like to process use DATASET, drop D4* D5* D6* etc

If you look at the helpfile of -use-, you can see that it is possible
to specify the variables you want to include. You may also want to
look at -help describe-, which you can use to get a list of variable
names without first opening the dataset.

-- Maarten

Maarten L. Buis
Reichpietschufer 50
10785 Berlin
*   For searches and help try:

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