Hi All,
I am struggling to combine my long panel data to pairs and wonder if anyone can give me a hint.
Suppose I have a long panel dataset
Time Country Variable
t1 a a1
t2 a a2
t3 a a3
t1 b b1
t2 b b2
t3 b b3
t1 c c1
t2 c c2
t3 c c3
I would like to convert this dataset to following format
Time Country Pair Variable
t1 ab a1-b1
t2 ab a2-b2
t3 ab a3-b3
t1 ac a1-c1
t2 ac a2-c2
t3 ac a3-c3
.....
.....
t1 cb c1-b1
t2 cb c2-b2
t3 cb c3-b3
I thought about first converting the long format to wide format but I have 100+ variables, and 50+ countries, so the wide format will have a lot of variables.
Any hint or suggestions are extremely appreciated!!
Thanks!
Related Posts with How to expand the panel data to pairs
qlqc30 command / stata deletes vars that dont need to be deletedhttps://journals.sagepub.com/doi/pdf...867X1501500407 Hi there, I have quality of life data that i …
Interpolate (extrapolate) values (mipolate)Hi Everyone, As my data set has some missing values, I have used the "mipolate" command found in st…
The modification of survey questions that are not replicated throughout years but have similar meaningDear members of Statalist, I am writing here regarding a dilemma that I have. I have a dataset from …
Non-linear constraint in a SURE estimationDear Statalist contributors, I am trying to estimate a system of seemingly unrelated labor supplies…
Get overview of my (unbalanced) panel dataHello everyone, I have to say at first that I'm far from being a Stata expert, but I have to use it…
Subscribe to:
Post Comments (Atom)
0 Response to How to expand the panel data to pairs
Post a Comment