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
Deleting NA'sHi, I have imported cvs file and now some variables have NA's and not . I can't use the command dro…
Time series dataI have data on Bitcoin price and S&P500 price development from Oct. 6th 2020 - Dec. 27th 2013, i…
Expanding dataset to create pairwise combinationsHi All, My dataset is as follows: Code: * Example generated by -dataex-. To install: ssc install…
How to construct variables based on items from a survey using scaleHi, I have a dataset from a questionnaire with 498 observations. There is item nonresponse present, …
Problem with generating counts of unique episodes within an ID based on the specific ruleHi everyone, I have data on patients receiving certain medication captured as 9-months episodes. I …
Subscribe to:
Post Comments (Atom)
0 Response to Duplicating time observations in panel data in stata
Post a Comment