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

Re: st: Re: Keeping groups

From   "Joseph Coveney" <>
To   "Statalist" <>
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:

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