A Julia package for easy access to the Ken French Data Library. The Ken French Data Library is one of the most highly used publicly available data sources for financial investments and asset pricing research.
Working with the data is sometimes tedious because the downloadable files come (1) compressed in
zip archives and (2) having non-standard
csv layouts. This package handles both of those hurdles, allowing users to get to the data faster.
To add the package, type
] add FamaFrenchData at the Julia REPL.
Once added, type
using FamaFrenchData to import the package.
The package exports 3 functions:
For help with any of these functions, use
? at the REPL (eg.
The Fama-French 3 factor model is a commonly used empirical asset pricing model. This example retrieves the full time series of FF3 monthly and annual returns.
using FamaFrenchData, DataFrames tables, tablenotes, filenotes = readFamaFrench("F-F_Research_Data_Factors") FF3_monthly = tables FF3_annual = tables
If you would rather store the file locally (perhaps so your code is reproducible later on), use
savename = "path/to/my/file.csv" downloadFamaFrench(savename,"F-F_Research_Data_Factors") tables, tablenotes, filenotes = readFamaFrench(savename) # also reads local files
To get a list of all of the available table names, use
FFnames = listFamaFrench()
- Original files use
-999to encode missing values, I attempt to replace these with
- Original files have no column heading for column 1, I name this column
:Date. It maintains the parsed type of
Intbecause it can take several different forms:
- I have not verified that all tables are parsed correctly.
- Breakpoints files require the keyword argument
I am not affiliated with the Ken French Data Library. This package does not "ship with" the data, just provides easier access to it. Other than the changes that I have explicitly stated, I do not alter the data; however, it is your responsibility to verify that the data is correct.