Statalist The Stata Listserver


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

Re: st: Re: Deleting a cohort


From   David Kantor <kantor.d@att.net>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Re: Deleting a cohort
Date   Thu, 29 Mar 2007 09:43:15 -0400

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/




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