Statalist The Stata Listserver


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

st: Select observations within variable


From   "Nikolaos Kanellopoulos" <nkkanel@yahoo.gr>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Select observations within variable
Date   Mon, 26 Feb 2007 21:24:21 -0000

Dear all,

I have a very common panel data set. i is my individual identifier, t my
time variable and x is a categorical variable. I want to create a variable
that will be 1  for all the observations of the same individual after x is
reduced. ie I want to identify all the observations for the same individual
after a reduction on x has taken place. Note that a reduction does not
happen to all individuals.

In the following example I want my new variable to be 1 for observations 5,6
and 7. 

+-----------+
i   t   x 
-----------
1.  1   1   1 
2.  1   2   1 
3.  1   3   2 
4.  1   4   2 
5.  1   5   1 
-----------
6.  1   6   2 
7.  1   7   1 
+-----------+

Thanks in advance
Nikos

__________________________________________________
Χρησιμοποιείτε Yahoo!;
Βαρεθήκατε τα ενοχλητικά μηνύματα (spam);   Το Yahoo! Mail διαθέτει την καλύτερη δυνατή προστασία κατά των ενοχλητικών μηνυμάτων  
http://mail.yahoo.gr 
*
*   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