Dear all,
Thanks in advance for any suggestions and supports!
I am currently working on a dataset with three variables that looks like the following
This dataset contains random records of ids in different groups at different years. I am hoping to expand the dataset to track the historical ids (of all previous years) of groups in each year.
The new data structure should ideally look like the following
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.
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.
Comment