BookmarkSubscribeRSS Feed
RDellaVilla
Fluorite | Level 6

Hello, I have to perform this following task in a replication step aimed at a research. 

 

"To compute FFC-adjusted returns for day t, I first estimate individual stock factor loadings by regressing delisting-adjusted excess returns on the FFC four factors (including an intercept) on a 120-trading day rolling window from t –150 to t –31 trading days for each stock".

 

I think I have properly sorted out my dataset so as to have the data in the desired form. Still, I have troubles in performing this time series regression. Moreover, my sample is really big, so I would require something which does not takes ages to run. 

Any suggestions on how to carry on? 

 

Thanks,

Riccardo

 

4 REPLIES 4
sbxkoenk
SAS Super FREQ

Hello,

 

If you have your input data set right (I guess you shifted the target column such that the x-vector for day [t-31] is in the same observation as the target y for day [t]?), then use THE BRUTE FORCE APPROACH as explained in this paper:

 

Rolling Regressions with PROC FCMP and PROC REG
Mark Keintz, Wharton Research Data Services, University of Pennsylvania

https://www.lexjansen.com/nesug/nesug12/fi/fi08.pdf

 

After creating the data set RWIN (TYPE=VIEW), like done on page 1, call your procedure (for example proc autoreg) with the by-variable "w".

 

This BRUTE FORCE APPROACH is of course greedy. Much more efficient techniques can be programmed.

Let us know if the real-time (time-to-completion) of your PROC by w takes too long.

 

By the way, for time series regression it's better to post your question in the SAS Forecasting and Econometrics board.

 

Good luck,

Koen

 

RDellaVilla
Fluorite | Level 6
Thank you Koen for the help.

I have tried and it is not actually working properly. Indeed, it takes quite a long time as my dataset is big, not to say enormous.

I will try to look for something a little bit more efficient. Still, thank you for this BRUTE FORCE APPROACH.
RDellaVilla
Fluorite | Level 6

To compute FFC-adjusted returns for day t, I first estimate individual stock factor loadings by regressing delisting-adjusted excess returns on the FFC four factors (including an intercept) on a 120-trading day rolling window from t –150 to t –31 trading days for each stock

 

this is exactly my issue. 

I feel I have sorted out data properly, setting the date of interest t, and the estimation window for each date t. I now have predict the value in t with the estimation period data. 

mkeintz
PROC Star

You want to make rolling window datasets (or even rolling window SSCP's - sum-of-squares-and-cross-products) to perform your regressions, correct?

 

You can take a look at these papers/presentations/comments I made on this subject:

 

  1. Philadelphia SAS User's Group (2019) - slide deck.

    Rapid Rolling Window Regressions via Home Made Sum of Squares and Cross Products (philasug.org)

  2. Northeast SAS Users Group (2012) - paper presentation

    Rolling Regressions with PROC FCMP and PROC REG (lexjansen.com)

  3. SAS Communities forum

    How to create rolling windows with different numbe... - SAS Support Communities



 

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 632 views
  • 0 likes
  • 3 in conversation