We download the dataset directly from Kenneth French’s Data
Library.
This dataset contains monthly returns for the six portfolios formed on
Size and Book-to-Market.
url <- "https://mba.tuck.dartmouth.edu/pages/faculty/ken.french/ftp/6_Portfolios_2x3_CSV.zip"
temp <- tempfile()
download.file(url, temp)
data_raw <- read_csv(unz(temp, "6_Portfolios_2x3.csv"), skip = 15)
## New names:
## • `` -> `...1`
## Warning: One or more parsing issues, call `problems()` on your data frame for details,
## e.g.:
## dat <- vroom(...)
## problems(dat)
## Rows: 8889 Columns: 7
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (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.
We keep observations from January 1930 to December 2018 and fix column types.
data <- data_raw %>%
rename(Date = ...1) %>%
filter(!is.na(Date)) %>%
filter(Date >= 193001 & Date <= 201812) %>%
mutate(across(-Date, as.numeric)) %>%
mutate(across(-Date, ~ . / 100))
head(data)
## # A tibble: 6 × 7
## Date `SMALL LoBM` `ME1 BM2` `SMALL HiBM` `BIG LoBM` `ME2 BM2` `BIG HiBM`
## <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 193001 0.0603 0.0952 0.0847 0.0736 0.0335 0.0285
## 2 193002 0.0176 0.0107 0.0457 0.0347 0.0188 0.0121
## 3 193003 0.0868 0.113 0.107 0.0676 0.0842 0.0535
## 4 193004 -0.0710 -0.0125 -0.0348 -0.0234 -0.0176 -0.0668
## 5 193005 -0.0361 -0.0269 -0.0299 0.00702 -0.0228 -0.0140
## 6 193006 -0.180 -0.165 -0.190 -0.177 -0.132 -0.118
The returns are now converted from percent to decimal form.
Divide the dataset into two equal halves.
n <- nrow(data)
half <- floor(n/2)
first_half <- data[1:half, ]
second_half <- data[(half + 1):n, ]
We calculate the following statistics for each portfolio:
calc_stats <- function(df) {
df %>%
summarise(across(
-Date,
list(
Mean = mean,
SD = sd,
Skew = skewness,
Kurt = kurtosis
),
na.rm = TRUE
))
}
stats_first <- calc_stats(first_half)
## Warning: There was 1 warning in `summarise()`.
## ℹ In argument: `across(...)`.
## Caused by warning:
## ! The `...` argument of `across()` is deprecated as of dplyr 1.1.0.
## Supply arguments directly to `.fns` through an anonymous function instead.
##
## # Previously
## across(a:b, mean, na.rm = TRUE)
##
## # Now
## across(a:b, \(x) mean(x, na.rm = TRUE))
stats_second <- calc_stats(second_half)
stats_first
## # A tibble: 1 × 24
## `SMALL LoBM_Mean` `SMALL LoBM_SD` `SMALL LoBM_Skew` `SMALL LoBM_Kurt`
## <dbl> <dbl> <dbl> <dbl>
## 1 1.65 3.83 2.53 8.33
## # ℹ 20 more variables: `ME1 BM2_Mean` <dbl>, `ME1 BM2_SD` <dbl>,
## # `ME1 BM2_Skew` <dbl>, `ME1 BM2_Kurt` <dbl>, `SMALL HiBM_Mean` <dbl>,
## # `SMALL HiBM_SD` <dbl>, `SMALL HiBM_Skew` <dbl>, `SMALL HiBM_Kurt` <dbl>,
## # `BIG LoBM_Mean` <dbl>, `BIG LoBM_SD` <dbl>, `BIG LoBM_Skew` <dbl>,
## # `BIG LoBM_Kurt` <dbl>, `ME2 BM2_Mean` <dbl>, `ME2 BM2_SD` <dbl>,
## # `ME2 BM2_Skew` <dbl>, `ME2 BM2_Kurt` <dbl>, `BIG HiBM_Mean` <dbl>,
## # `BIG HiBM_SD` <dbl>, `BIG HiBM_Skew` <dbl>, `BIG HiBM_Kurt` <dbl>
stats_second
## # A tibble: 1 × 24
## `SMALL LoBM_Mean` `SMALL LoBM_SD` `SMALL LoBM_Skew` `SMALL LoBM_Kurt`
## <dbl> <dbl> <dbl> <dbl>
## 1 0.392 1.41 4.41 23.3
## # ℹ 20 more variables: `ME1 BM2_Mean` <dbl>, `ME1 BM2_SD` <dbl>,
## # `ME1 BM2_Skew` <dbl>, `ME1 BM2_Kurt` <dbl>, `SMALL HiBM_Mean` <dbl>,
## # `SMALL HiBM_SD` <dbl>, `SMALL HiBM_Skew` <dbl>, `SMALL HiBM_Kurt` <dbl>,
## # `BIG LoBM_Mean` <dbl>, `BIG LoBM_SD` <dbl>, `BIG LoBM_Skew` <dbl>,
## # `BIG LoBM_Kurt` <dbl>, `ME2 BM2_Mean` <dbl>, `ME2 BM2_SD` <dbl>,
## # `ME2 BM2_Skew` <dbl>, `ME2 BM2_Kurt` <dbl>, `BIG HiBM_Mean` <dbl>,
## # `BIG HiBM_SD` <dbl>, `BIG HiBM_Skew` <dbl>, `BIG HiBM_Kurt` <dbl>
We compare the statistical properties of the portfolios between the two halves of the sample.
If the mean, standard deviation, skewness, and kurtosis differ noticeably between the two periods, this suggests that the returns may not be drawn from the same distribution. Financial markets change over time due to economic conditions, policy changes, and structural shifts, so it is common to observe differences across long periods.
This analysis examined the statistical properties of six Fama-French portfolios across two different time periods. Differences in mean returns, volatility, skewness, and kurtosis may indicate that return distributions evolve over time. In the second part of the assignment, we computed the expected payoff from a risky equity investment and compared it to a risk-free Treasury bill. The resulting risk premium illustrates the compensation investors expect for bearing financial risk.