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.
Normally, one does not speak of correlation between row 1 and row 2 of a data set. The correlation is not defined in this manner, and has no particular meaning. (Or, it is a degenerate case where the correlation between row 1 and row 2 is always equal to ±1)
One can speak of a correlation of ALL the rows for a given variable where ID = 1, and a correlation between all the rows where ID = 2, but this is different than your row-by-row correlation.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.