Thanks in advance for any suggestions and supports!
I am currently working on a dataset with three variables that looks like the following
group | year | id |
1 | 2000 | 1 |
1 | 2000 | 2 |
1 | 2001 | 5 |
2 | 2007 | 1 |
2 | 2007 | 3 |
2 | 2008 | 4 |
2 | 2010 | 5 |
The new data structure should ideally look like the following
group | year | id |
1 | 2000 | 1 |
1 | 2000 | 2 |
1 | 2001 | 1 |
1 | 2001 | 2 |
1 | 2001 | 5 |
2 | 2007 | 1 |
2 | 2007 | 3 |
2 | 2008 | 1 |
2 | 2008 | 3 |
2 | 2008 | 4 |
2 | 2010 | 1 |
2 | 2010 | 3 |
2 | 2010 | 4 |
2 | 2010 | 5 |
I have tried to use suggestions from this link: https://stats.idre.ucla.edu/stata/fa...time-variable/.
However, my dataset is not exactly a panel dataset. Does anyone have suggestions for this issue? I would appreciate any advice.
This question is cross-posted in the Mata forum too.
0 Response to Changing data structure (Expanding observations) with previous value
Post a Comment