Goal

Calculate and visualize your portfolio’s beta.

Choose your stocks and the baseline market.

I chose the stocks XOM, CVX, COP, SLB and EOG. I chose them because they are all competitors within the aame industry.

from 2012-12-31 to present

1 Import stock prices

2 Convert prices to returns

3 Assign a weight to each asset

## [1] "COP" "CVX" "EOG" "SLB" "XOM"
## [1] 0.25 0.25 0.20 0.20 0.10
## # A tibble: 5 × 2
##   symbols weights
##   <chr>     <dbl>
## 1 COP        0.25
## 2 CVX        0.25
## 3 EOG        0.2 
## 4 SLB        0.2 
## 5 XOM        0.1

4 Build a portfolio

## # A tibble: 60 × 2
##    date        returns
##    <date>        <dbl>
##  1 2013-01-31  0.0505 
##  2 2013-02-28  0.0104 
##  3 2013-03-28  0.00924
##  4 2013-04-30 -0.00521
##  5 2013-05-31  0.0210 
##  6 2013-06-28 -0.0117 
##  7 2013-07-31  0.0847 
##  8 2013-08-30  0.00496
##  9 2013-09-30  0.0453 
## 10 2013-10-31  0.0392 
## # ℹ 50 more rows

5 Calculate CAPM Beta

5.1 Get market returns

5.2 Join returns

5.3 CAPM Beta

## # A tibble: 1 × 1
##   CAPM.beta.1
##         <dbl>
## 1        1.08

6 Plot

Scatter with regression line

Actual versus fitted returns

How sensitive is your portfolio to the market? Discuss in terms of the beta coefficient. Does the plot confirm the beta coefficient you calculated?

My portfolio has a CAPM beta of 1.08, which means it is slightly more sensitive to the market than a well diversified market portfolio. A beta of 1.08 implies that if the market goes up by 1%, I would expect my portfolios returns to increase by 1.08%. The plot of the portfolio returns versus market returns supports this beta estimate. In the scatterplot, the point shows a clear upward sloping relationship and the fitted regression line is steeper than a 45 degree line, which matches a beta just above 1.