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?
GLS Fixed Effects regression, Omitted because of CollinearityDear Stata community, Hi, I have a panel data (Company ID, years) independent variables(MTB, size, …
adjustrcspline errorI'm trying to fit an stcox model with cubic splines to see the association between mortality and rat…
Resize graphs for putexcel but obtain good qualityDear all I am creating a data report with Excel and use putexcel to transfer the Stata graphs to ex…
Clarification on Methods used for 95% CI Calculation in sts list CommandsHello, Would anyone be able to clarify the following three questions about the methods Stata uses t…
generating a new variable based on 2 conditionshello there new stata user i have a dataset that look like this date_m com date com_ret Date com_c…
Subscribe to:
Post Comments (Atom)
0 Response to How do I expand period data into data by year?
Post a Comment