BookmarkSubscribeRSS Feed
avecesar97
Fluorite | Level 6

Hi, I have three variables: date, stock returns and market returns. I want to compute correlations such as I only use return information from the past 5 years, hence if I am in February 2019 I´d like to compute the correlation between stock returns and market returns beginning February 2014. SAS Procedures such as proc expands are not available for SAS University as far as I know. 

2 REPLIES 2
PaigeMiller
Diamond | Level 26

If you search the internet for "rolling window regressions", there are several pieces of SAS code presented, that could be adapted to produce correlations. In particular, there is one code that works without macros that would apply with only minor modifications to correlations. I also recall a thread here in the SAS communities on the subject of rolling window correlations that I participated in, and I leave it to you to search for it.

--
Paige Miller

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 948 views
  • 0 likes
  • 2 in conversation