BookmarkSubscribeRSS Feed
PaigeMiller
Diamond | Level 26

@Wafflecakes wrote:

 

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.

 

So, could you please clarify?

--
Paige Miller

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 0 replies
  • 458 views
  • 0 likes
  • 1 in conversation