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
Identify observations with criteria that occur first time after at least five yearsDear members, I have an unbalanced panel data on companies and their financial accounts for 15 year…
Discrete Time Hazard, Competing RisksHi, I am working on a survival time model using linear probability model. Discrete survival time mo…
How to specify variable labels for the x-axis in several linesHello I would like to specify the variable names in several lines of a graph, because they are very …
tobit with vce (cluster clustervar) or xttobitDear all, I'm working with a unbalanced panel data set with 208500 observations from 3371 firms in …
Referring to dates using business calendarsDear Stata list, I am using time series data with a business calendar as I only look at trading dat…
Subscribe to:
Post Comments (Atom)
0 Response to Reshaping data from monadic to dyadic
Post a Comment