BookmarkSubscribeRSS Feed
bukky09
Fluorite | Level 6

Hi,

I am trying to find the first order autocorrelation of monthly returns for each mainstrategy. This autocorrelation should be calculated based on a 5 year rolling window. I need some help with the approprate code. I have tried others but didnt work.

so I have a data set as such

Date       Return     AUM    mainstrategy

199512   -0.0055   26.9     Relative value

199601    0.0048   27.1      Relative value

199602    0.0089   30.7      CTA

Thank you

3 REPLIES 3
bukky09
Fluorite | Level 6

I need help with the apropriate code. I have tried others but it didnt wok. Kindly provide the help you can

Thank you

Reeza
Super User

Please post sample data and what you've tried. Also, do you have SAS/ETS licensed? If so, look into proc expand - the documentation has a good example of transformations. 

Ksharp
Super User

Check this :

https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Moving-window-for-AR-1/m-p/245165#U245165

 

I suggested you post it at IML forum

SAS/IML Software and Matrix Computations

It is easy to be done in IML, or you can resort to SAS/ETS if you have it .

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 3 replies
  • 824 views
  • 0 likes
  • 3 in conversation