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

st: RE: AW: drop multiple observations

From   "Nick Cox" <>
To   <>
Subject   st: RE: AW: drop multiple observations
Date   Fri, 11 Dec 2009 17:06:07 -0000

Just to mention another solution (not as good in this example) 

drop if id==2 || id==215 || id==302 || id==420 || id==579


Martin Weiss

drop if inlist(id, 2, 215, 302, 420, 579)

Shehzad Ali

If I have a dataset with 1000 observations (uniquely identified using
variable - id -), can I drop multiple observations using one line? I
one can drop observations that are say id>350 or <20, but if the
observations are all over the place could we still use a one line

For example, instead of typing:

drop if id==2
drop if id==215
drop if id==302
drop if id==420
drop if id==579

Can I use one line to drop all the above?

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index