Dear,
I have a data organized such that each observation is assigned to country in an eventID by year:
EventID Country Year
88 220 1870
88 271 1870
88 255 1870
220 3251870
220 710 1870
220 2 1870
220 220 1870
2117 70 1870
2117 70 1870
2168 255 1871
2168 255 1871
2169 365 1871
2169 220 1871
256 230 1872
256 2 1872
256 200 1872
I need this reshaped to dyad/year data under EventID to merge the other data which is a dyadic trade data, so the following shape is what I want to reshape.
EventID Country Country2 Year
88 220 271 1870
88 220 255 1870
88 220 325 1870
88 271 220 1870
88 271 255 1870
88 271 325 1870
88 325 220 1870
88 325 271 1870
88 325 255 1870
.
.
.
256 2 200 1872
256 200 2 1872
.
.
.
I've tried to create a dyadic data by using egen country2 group('var' 'var1') to merge it with a dyadic trade data.
But, I think I need to reshape the data first before merging two data.
Would anyone help me to reshape this data?
Best Regards,
Woo
Related Posts with Reshaping data from monadic to dyadic
using lrtest to compare an empty, individual level and two-level xtmixed model after multiple imputationI am using Stata 14/IC - I have successfully conducted a multiple imputation using chained equations…
Generating a variable depending on time variableHello, I am using Stata/SE 14.2 for Mac. I am working on my thesis that is about resistant bacteria…
Can I run a xtologit on a 0.5-paced score as dependent variable?Hi everyone, I'm working on panel data with firm ID as panelvar and report_period as timevar. I've…
format of numeric IDs for mergerHi, all, I have trouble with some IDs before (and after..) a merger. I want to 'mirror' and ID varia…
Difference in mediansHello, I am trying to calculate the median difference between two variables. I have read about the …
Subscribe to:
Post Comments (Atom)
0 Response to Reshaping data from monadic to dyadic
Post a Comment