library(readr)
data <- read_csv("data of hw2.csv")
## New names:
## Rows: 1068 Columns: 7
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," dbl
## (7): ...1, SMALL LoBM, ME1 BM2, SMALL HiBM, BIG LoBM, ME2 BM2, BIG HiBM
## ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
## Specify the column types or set `show_col_types = FALSE` to quiet this message.
## • `` -> `...1`
print(data)
## # A tibble: 1,068 × 7
## ...1 `SMALL LoBM` `ME1 BM2` `SMALL HiBM` `BIG LoBM` `ME2 BM2` `BIG HiBM`
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 193001 6.05 9.56 8.46 7.17 3.40 2.84
## 2 193002 1.75 1.05 4.38 3.46 1.90 1.22
## 3 193003 8.64 11.4 10.8 6.82 8.36 5.34
## 4 193004 -7.07 -1.23 -3.48 -2.36 -1.71 -6.66
## 5 193005 -3.62 -2.42 -2.96 0.706 -2.26 -1.41
## 6 193006 -17.5 -16.5 -18.9 -17.8 -13.1 -11.8
## 7 193007 6.52 3.73 2.43 4.71 3.55 5.28
## 8 193008 -3.76 -1.61 -2.27 1.02 -0.66 -1.70
## 9 193009 -13.7 -14.7 -18.8 -12.4 -10.9 -17.2
## 10 193010 -10.1 -7.68 -10.7 -9.35 -7.27 -11.5
## # ℹ 1,058 more rows
# Given probabilities and expected returns for equities
probabilities <- c(0.6, 0.4)
returns_equities <- c(50000, -30000)
# Risk-free return (T-bills)
return_tbill <- 5000
expected_return_equities <- sum(probabilities * returns_equities)
print(paste("Expected return for equities:", expected_return_equities))
## [1] "Expected return for equities: 18000"
risk_premium <- expected_return_equities - return_tbill
print(paste("Risk premium:", risk_premium))
## [1] "Risk premium: 13000"