Dear statlist,
i am trying to calculate correlation coefficients for a panel dataset.
Suppose you have the following dataset on IDs and years:
Obviously, variable X is an ID and Year specific item. I would like to calculate, let say for time t=1994 the correlation of variable X between ID 10 and 11 for the years 1992-1994.
I know this might be a very straightforward question. However, I tried several things but could not find a convenient solution.
Thanks in advance!
Best,
Alex L
i am trying to calculate correlation coefficients for a panel dataset.
Suppose you have the following dataset on IDs and years:
Year | ID | X |
1992 | 10 | 2600 |
1992 | 11 | 1000 |
1993 | 10 | 800 |
1993 | 11 | 700 |
1994 | 10 | 6000 |
1994 | 11 | 2500 |
I know this might be a very straightforward question. However, I tried several things but could not find a convenient solution.
Thanks in advance!
Best,
Alex L
Comment