Good afternoon, I'm working on my master thesis in Statistics at University of Bologna and I have a problem with my code. I have a dataset as shown in attachment.
I'd like to remove observation within each level of id, when the variable event[_n-1]==0.
For example, i'd like to get:
id event
1 1
1 1
1 0
2 1
2 1
2 1
2 0
and so on.
I tried so many options, but they never worked, I'd like to know if there is a solution.
Thanks a lot.
Anna
Related Posts with stata levelsof
Building cross-lagged panel models with categorical variables on StataCan someone here suggest to me a suitable way to build a cross-lagged panel model with categorical v…
The intersection of two Chinese variablesDear All, I found this question here (in Chinese). The data set is Code: * Example generated by -da…
Seasonality in annual data? Problem or not?Hello, I have a panel data at an annual frequency. When I use the xtline command to get the linear p…
Synthetic Control - minimum number of obs?Can I build a synthetic control with 6 pre-treatment observations and 4 post-treatment? Is it valid,…
Ranking the most important predictor variables from a series of regression models.Hi, I came across an interesting study that did the following: 'number of births in the last 5 yea…
Subscribe to:
Post Comments (Atom)
0 Response to stata levelsof
Post a Comment