Hello,
I have a time series sample of 4000 firms over 18 years period (2000-2017). I am trying to find a way to use the daily returns in order to estimate the annual beta for each stock. I am unsure of what code to use. Any advice or guidance on how to structure my SAS code is highly appreciated. (SAS version 9.4)
My data is structured as follows:
PERMCO DATE COMPANY_NAME RETURN MARKET_RETURN YEAR PERMCO&YEAR
153 2000-02-01 -0.15 2000 1532000
153 2000-02-02 0.1 2000
153 2000-02-03 0.2 2000
153
.
.
.
153 2017-12-28
674
674
674
.
.
.
2114
2114
211
etc...
I would like the output to look something like shown below: (1 beta for each stock per year)
PERMCO YEAR BETA
153 2000
153 2001
153 2002
674 2015
2114 2017
etc...
Thank you
@Rick_SAS wrote a blog about how to run thousands of Regression before.
proc reg data=have outest=want;
by PERMCO YEAR ;
model RETURN = date;
quit;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.