BookmarkSubscribeRSS Feed
renjithradhakri
Calcite | Level 5

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. 

3 REPLIES 3
Reeza
Super User

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. 


 

renjithradhakri
Calcite | Level 5

beta.PNG

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.

Reeza
Super User

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

SAS Innovate 2025: Save the Date

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

Save the date!

SAS Enterprise Guide vs. SAS Studio

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1568 views
  • 0 likes
  • 2 in conversation