Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Re: Keeping groups


From   "Joseph Coveney" <jcoveney@bigplanet.com>
To   "Statalist" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Re: Keeping groups
Date   Mon, 26 May 2008 12:52:54 +0900

Michael Blasnik wrote (excerpted):

Not sure if I understand exactly what you want, but this may do it:

bysort group (nocell): drop if nocell[1]!1 | nocell[_N]!=1

--------------------------------------------------------------------------------

Just a typo in Michael's suggestion:

bysort group (nocell): drop if nocell[1] != 1 | nocell[_N] != 1

Bracketing operators with spaces makes them more visible, and it seems that
the code is then is a bit easier to decipher and that it's somewhat easier
to spot coding errors.  I believe that Stata handles white space around
operators similarly to how SAS does, so that you should be able to keep your
preference as far as this goes when coming to Stata from SAS.

Joseph Coveney


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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