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;
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!
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.