Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Keeping observations


From   n j cox <[email protected]>
To   [email protected]
Subject   Re: st: Keeping observations
Date   Thu, 09 Jun 2005 13:08:45 +0100

. sort id, stable
. by id: keep if employ[1] == 2

Patricia Vera Rojas

I have :

id employ
1 2
2 1
3 2
3 2
4 2
4 1
5 1
5 2
6 1
6 1

where id= subject identification and employ=1 if the person is employed and employ=2 if the person
is unemployed.
I want to keep in the data those subjects whose are unemployed in the first observation (employ=2)
without losing their second observation if they are observed more than once, that is:

id employ
1 2
3 2
3 2
4 2
4 1

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