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

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 702 views
  • 0 likes
  • 2 in conversation