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

st: data suppression in Stata


From   Rajiv Sinha <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: data suppression in Stata
Date   Sat, 31 Aug 2002 10:52:16 -0700

Title: Blank

I have a very large panel data set that looks as follows:  people tracked over time and data on occurance of an event and a lot of time varying covariates (not shown below).

Person       Time          Event Time       X

1                    1                      2                1

1                    2                       2                3

1                    3                       2                20

2                    1                       1                5

2                    2                       1                 6

2                    3                        1                9

etc...

I need to suppress these data as follows:  since the event occured for person 1 at time 2 I want to drop all data pertaining to him for period 3 and keep data only for period 1 and 2.  Similarly for person 2, since the event occured at time 1, I want to drop all data after this point and keep data only for period 1.  The final data should be:

Person       Time          Event Time       X

1                    1                      2                   1

1                    2                       2                 3

2                    1                       1                   5

How do I do this in Stata?   Thanks in advance.




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