Hi,
I am doing a research where I have to find the monthly beta of around 1000 stocks for 15 years. I have created a SAS table which contain daily historic data of all the stocks and also the market from 2002 to 2017. I would like to find the monthly beta with 30 data points without overlapping values. I would highly appreciate if somebody could help with the coding.
What is Beta? Please post some sample data that reflects your actual data and anything you've attempted as well.
@renjithradhakri wrote:
Hi,
I am doing a research where I have to find the monthly beta of around 1000 stocks for 15 years. I have created a SAS table which contain daily historic data of all the stocks and also the market from 2002 to 2017. I would like to find the monthly beta with 30 data points without overlapping values. I would highly appreciate if somebody could help with the coding.
Thank you for your reply!
In excel beta is often calculated by either calculating the slope or by covariance.
Beta =covariance.p(B2:B32,A2:A32)/var.p(A2:A32) or
Beta = SLOPE (A2: A32; B2:B32)
In this formula column A is the market and B is the stock to be calculated. In the screen shot MSCI_Return is the market.
Do you have SAS/ETS? If so, look into PROC EXPAND. If you don’t, there are also some links here on how to do that with a data step.
If you search on here, this has been asked at least twice this year so far and there are answers on here as well.
https://blogs.sas.com/content/iml/2016/01/27/moving-average-in-sas.html
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!What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: