Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Forecasting
- /
- Re: Regression

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 03-27-2021 05:00 PM
(859 views)

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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:

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

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

- Northeast SAS Users Group (2012) - paper presentation

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

- 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

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

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

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

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

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.