Hi, I have balanced panel data with ID and Time (and some other variables), and I want the unique ID-pairs, while preserving the time order. The suggestions I've found seem to offer much more complicated combinations. The simplest example I can think of (while still being clear) has 3 individuals and 3 time periods. In general, if the original data set is n*T obs, the transformed data set should be (n*n-1)/2*T) obs. I can do this with loops, but I'm guessing there is a clever way to do it w/out loops. Thanks for your help.
ID1 t1
ID1 t2
ID1 t3
ID2 t1
ID2 t2
ID2 t3
ID3 t1
ID3 t2
ID3 t3
I would like the resulting data to look like:
ID1-ID2 t1
ID1-ID2 t2
ID1-ID2 t3
ID1-ID3 t1
ID1-ID3 t2
ID1-ID3 t3
ID2-ID3 t1
ID2-ID3 t2
ID2-ID3 t3
If it helps, my transformed data could be as simple as the difference in the values of a variable for the different IDs for each time period.
Related Posts with unique pairs from panel data
Numbering Similar ObservationsHello, I'm having significant difficulty numbering observations. I've attached a screenshot for cla…
MergeHi all, I have the following two datasets. The first one looks like follows: Code: * Example gene…
import tfw or tif data on STATAHello, I am very new at geographic data analysis. I have the project to use tfw or tif datasets (NOA…
type mismatch in a regression with &Hello, When I run this regression : xi: areg z_educ i.stateid hhsize highest_maleeduc highest_femed…
Correlation tables and R-squared in panel dataDear all, currently I'm running a panel regression as a part of a seminar. My topic is the statisti…
Subscribe to:
Post Comments (Atom)
0 Response to unique pairs from panel data
Post a Comment