Hi,
Suppose I have the following dataset
id year measure1 measure2
1 2000 0.41 -
1 2001 0.19 0.50
1 2002 0.51 0.75
1 2003 0.91 0.29
2 2000 0.69 -
2 2001 0.40 0.69
2 2002 0.69 0.29 2
2003 0.79 0.39
How would I do a correlation between consecutive years (grouped by id)? e.g. Correlation between measure1 in 2001 with measure1 in 2000, measure1 in 2002 with measure1 in 2001, etc.
Thank you,
Related Posts with Correlations between consecutive observations
Fixed effect model with controlled variablesHi all. I am using a fixed-effect model to reveal the impact of some factors on the land price (I ha…
closest relative match based on multiple variables after exact matchingDear Statalisters, I have the following problem: I am trying to match two survey waves (let's call …
automatically creating year variable for panel dataHi, I am a beginner in Stata. recently I spent a lot of day in creating a panel data, I have a huge …
if else conditional of number of elements in a localHi, I am trying to set a condition within a nested loop. Now, the loop opens some folders; the cond…
Question about double quotesHi dear all, I want to rename all variabls. ----------------------- copy starting from the next line…
Subscribe to:
Post Comments (Atom)
0 Response to Correlations between consecutive observations
Post a Comment