Hello Stata community,
I am looking to duplicate the time observations in a panel data 17 times, whiles keeping the data in long-format in Stata. I have tried the following commands:
expandby 17, by(id) sort(time)
expandby 17, by(id) sort()
In either case, only the last year is duplicated for each country or some years’ observations are duplicated. I would appreciate your feedback on the right code to use
Thanks,
Rex
Related Posts with Duplicating time observations in panel data in stata
Counting Instance of a variable and returning averageI am a student and new to Stata. Any help is appreciated. I have a data set with age and weight. I …
change from row to collumn without reshapehi I have a long data. i would like that each categorie of one variable "class" became a collumn, wi…
Creating an expression that tells marginal impact of moving one independent variable to another independent variable.I have been working on a project over the last few months. The idea of this project is looking at ML…
Dropping certain observations of a variable in a specified rangeI want to drop only certain observations of l_growth for each naic that are between 1997Q1 and 2009Q…
calculating frequency of events by age-classHello stata-users, I need to create a two column dataset by age-class and number of events. I can d…
Subscribe to:
Post Comments (Atom)
0 Response to Duplicating time observations in panel data in stata
Post a Comment