Statalist The Stata Listserver


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

Re: st: Re: Deleting a cohort


From   "sara khan" <[email protected]>
To   [email protected]
Subject   Re: st: Re: Deleting a cohort
Date   Thu, 29 Mar 2007 14:52:09 +0100

You anticipated my problem. I missed the parens and it now works. Many thanks!

On 3/29/07, David Kantor <[email protected]> wrote:
At 09:04 AM 3/29/2007, Sergiy wrote:
>gen flag=0
>bys ID WAVE: replace flag=1 if empstat[1]="emp"
>keep if flag==1

Sara may have gotten her solution by now, but, that should be
 bys ID (WAVE): replace flag=1 if empstat[1]="emp"

Note the parens around WAVE.  Otherwise, each record will be treated
in isolation.  I've made this mistake many times.
--David

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

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index