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
how to generate sequence integer starting from 0 (by group)Hi, I have a panel data set and try to generate sequence numbers by group but the numbers starting f…
How can i convert a *.dsv file into a *.dta file?Hi I would like to work with a dataset of the recent president's election in Argentina. But I could…
Amemiya-Lee-NeweyI having problems using Amemiya-Lee-Newey test after ivprobit with in regression with 2 instruments.…
Using rcap scatter but can't figure out how to get 2 different colors of markersHi all, moderately new Stata user here using Version 15.1. I have two groups (male and female) to b…
Stata doesn't perform function. Do i have to change stata to another program?Dear statalist. I have data 2,000,000 observation. My stata version is 14 MP 8 core. My labtop Intel…
Subscribe to:
Post Comments (Atom)
0 Response to Reshaping data from monadic to dyadic
Post a Comment