We are analyzing data in the following format. Our question is,
how can we identify IDs where the difference between any 2 sequential values for "Level" is more than 2?
We have looked through SAS resources and, as relatively new programmers, can't figure this out.
Thank you!!
ID Date Level
1 01/01/2000 1
1 01/02/2000
1 01/05/2000 3
1 01/05/2010
2 01/06/2010 5
2 02/12/2005 6
How do you want to deal with cases where you're missing values between sequential values as in your data? Show your expected output please.
In general, you likely want the DIF function but it's a bit tricky to use if you're not familiar with SAS.
@anissak1 wrote:
We are analyzing data in the following format. Our question is,
how can we identify IDs where the difference between any 2 sequential values for "Level" is more than 2?
We have looked through SAS resources and, as relatively new programmers, can't figure this out.
Thank you!!
ID Date Level
1 01/01/2000 1
1 01/02/2000
1 01/05/2000 3
1 01/05/2010
2 01/06/2010 5
2 02/12/2005 6
Thank you for the note! We would like to ignore the observations for which we have no value.
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.