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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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