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?
reshape commandhi, I need to reshape a huge data set wide to long (2557 binary variables and 1.6 million observatio…
Hosmer–Lemeshow test for large data setsHosmer–Lemeshow test for large data sets gives low p value despite perfectly fitting model. Increasi…
Finite mixture model vs. Latent class modelHi scholars, Would you please explain the difference between Finite mixture model and Latent class …
Using Multiple Imputations in Propensity Score MatchingHello everyone, I want to see the impact of a treatment, hence, using the propensity score matching…
stata mp 15 computing speedhi, I recently upgraded to stata mp 15 in order to use the multi processor capabilities. however, wh…
Subscribe to:
Post Comments (Atom)
0 Response to How do I expand period data into data by year?
Post a Comment