Dear Stata supporters,
I am currently working on my master thesis and therefore want to use STATA. However, currently I hit a wall with my progress. Unfortunately I am not experienced enough to solve this problem by myself, neither after searching through this forum. Hopefully someone can help me out.
Currently my data is listed as follow:
Year Country VarX
1999 1 9
1999 2 99
1999 3 999
2000 1 8
2000 2 88
2000 3 888
Originally for more than 4500 observations. However, I would like to make pairs for country per year. Which should look as follow:
Year Country Country VarX VarX
1999 1 2 9 99
1999 1 3 9 999
1999 2 1 99 9
1999 2 3 99 999
1999 3 1 999 9
1999 3 2 999 99
2000 1 2 8 88
2000 1 3 8 888
And everything that comes after...
How can I make this happen? can someone help me out.
Related Posts with Create pairs within groups
Competing risks regression and time-varying covariatesDear Stata Listers, I wish to evaluate the effect that local recurrence has on the risk of ocular m…
Year and State Fixed EffectsHello guys, Please, I need help. I have questions about a year and state fixed effects. I have pane…
Total sum of squares when using reg and noconstant In the artificial data set below I estimated depvar = beta0 + beta1*year and depvar = beta1*year. U…
PSMATCH2: one to one matchingI would like to get a matched sample by running the code below Code: psmatch2 y x1 x2, logit common…
Looping running sum and total for changing range within grouped variables.Hi everyone, I'm relatively new to Stata so please excuse if the explanation of my problem sounds a…
Subscribe to:
Post Comments (Atom)
0 Response to Create pairs within groups
Post a Comment