Statalist


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

st: RE: AW: RE: AW: drop multiple observations


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: AW: RE: AW: drop multiple observations
Date   Mon, 14 Dec 2009 13:38:33 -0000

Martin is correct. Thanks for the fix. 

|| is legal for "or" in several languages, including Mata, but not in
Stata. 

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

Nick 
n.j.cox@durham.ac.uk 

Martin Weiss


BTW, I think Nick`s solution should be written with a single pipe symbol
for
it to work as intended:


clear*

inp byte( id number)
1 34
2 43
3 67
4 56
6 78
end

cap drop if id==2 || id==4
di in r _rc

drop if id==2 | id==4

The double pipes are for separation of subgraphs in a -twoway- graph or
levels in -xtmixed-...

Nick Cox:

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

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


*
*   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/



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