Accessing Kenneth French's US equity data

Kenneth French collects, updates, and makes available a treasure trove of datasets of U.S. American equity markets on his website at http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/. Many of these data are derived from the CRSP database (http://www.crsp.com/).

Since version 1.5, the NMOF package has provided a function French that helps with downloading datasets from Kenneth French's website. In this short note, the function and some of the datasets that is supports are showcased.

library("NMOF")
library("plotseries")
library("zoo")

The Fama/French factors

The numbers in the right margin are the annualised rates of return. All charts use a log scale.

series <- French("~/Downloads/French/",
                 "F-F_Research_Data_Factors_daily_CSV.zip",
                 frequency = "daily",
                 price.series = TRUE)
series <- zoo(series, as.Date(row.names(series)))

plotseries(series,
           col = hcl.colors(n = 12, palette = "Dark 2"),
           log.scale = TRUE,
           add.dollars = FALSE,
           labels = c("Market\n(excess return)",
                      "SMB", "HML", "RF"))
fama-french-1.png

The market (total return)

series <- French("~/Downloads/French/",
                 "market",
                 frequency = "daily",
                 price.series = TRUE)
series <- zoo(series, as.Date(row.names(series)))

plotseries(series,
           col = hcl.colors(n = 12, palette = "Dark 2"),
           log.scale = TRUE,
           labels = c("Market"))
fama-french-2.png

Momentum: portfolios weighted by market cap

series <- French("~/Downloads/French/",
                 "10_Portfolios_Prior_12_2_CSV.zip",
                 frequency = "monthly",
                 weighting = "value",
                 price.series = TRUE)
series <- zoo(series, as.Date(row.names(series)))

plotseries(series,
           col = hcl.colors(n = 30, palette = "Greens"),
           add.dollars = FALSE,
           log.scale = TRUE,
           labels = colnames(series))
fama-french-3.png

Momentum: portfolios equally weighted

series <- French("~/Downloads/French/",
                 "10_Portfolios_Prior_12_2_CSV.zip",
                 frequency = "monthly",
                 weighting = "equal",
                 price.series = TRUE)
series <- zoo(series, as.Date(row.names(series)))

plotseries(series,
           col = hcl.colors(n = 30, palette = "Greens"),
           add.dollars = FALSE,
           log.scale = TRUE,
           labels = colnames(series))
fama-french-4.png

Supported datasets

Invoking the function without any arguments results in a list of supported datasets.

French()
10_Portfolios_Prior_12_2_CSV.zip
10_Portfolios_Prior_12_2_Daily_CSV.zip
49_Industry_Portfolios_CSV.zip
49_Industry_Portfolios_daily_CSV.zip
6_portfolios_2x3_CSV.zip
6_portfolios_2x3_daily_CSV.zip
F-F_Momentum_Factor_CSV.zip
F-F_Momentum_Factor_daily_CSV.zip
F-F_Research_Data_Factors_daily_CSV.zip
ME_Breakpoints_CSV.zip
Portfolios_Formed_on_BE-ME_CSV.zip
Portfolios_Formed_on_VAR_CSV.zip
Portfolios_Formed_on_VAR_CSV.zip
Siccodes10.zip
Siccodes12.zip
Siccodes17.zip
Siccodes30.zip
Siccodes38.zip
Siccodes48.zip
Siccodes49.zip
Siccodes5.zip