Hello, relatively new user here, using stata for my university class and have a base level proficiency at it, and have self taught myself a good amount of what I have needed so far from this forum.
I am trying to merge two datasets together for a regression. The problem is that one of the datasets is paneled by country/year while the other one is country/period. These periods are 5 years each. What I am trying to do is duplicate each period 5 times, and then either rename the period variable or add a year variable so that each of those duplicates now represents one year from the period. For example, for period one, which is 1960-1964, I want to duplicate the period one observation 5 times, and rename so that there is one for 1960, 1961,etc. This way I can merge it smoothly with my other dataset. I have done some research and found the 'expand' command, but I could find no way to have each duplicate have a different name, making it difficult for me to give them each a unique year in an efficient way.
Any help would be appreciated, and apologies if this is a question that has already been answered, did my best to search but may have not used the right key words.
Related Posts with How do I expand period data into data by year?
Creating Composite Variable (from non-mutually exclusive categorial variables)Hi All, I am quite new to Stata. I have five variables which each ask whether cannabis has been con…
Any precise way to convert dialy to monthly: string 1/1/2019 to numeric 20190101?I have daily data in string format as 1/1/ 2019. The string length is different as there as values e…
Margins not estimableHello! I am trying to look at the effect mandatory elections (Valplikt) has on satisfaction with dem…
Panel dataDear Members I hope all is well. Please, I would like to know that : 1-) Should I use Xtset Command …
Staggered Difference in Difference*Hi My data has the following setup. I have individual level data for years 1995, 2000, 2005, 2010 a…
Subscribe to:
Post Comments (Atom)
0 Response to How do I expand period data into data by year?
Post a Comment