Proposed is a framework to create the five fama french return factors for the German Stock Market.
- Access to the Wharton Research Data Services
- WRDS offers a tutorial for accessing and manipulating their database
- R (at least verison 3.4.1 (2017-06-30 -- "Single Kandle"))
- get the newest version here
- packages:
install.packages("dplyr")
install.packages("data.table")
install.packages("maggitr")
install.packages("zoo")
install.packages("ggplot2")
install.packages("dtplyr")
install.packages("stringr")
install.packages("tidyr")
install.packages("GRS.test")
install.packages("broom")
- Fama_French_Factors.R : Main file to create FF factors and portfolios
- Get_Data.R : Download data from WRDS
- support_functions.R : helper functions
Final dataframe (all return data in percent):
Date MyRMRF MySMB MyHML MyRMW MyCMA RF
Jan 2017 3.6030333 4.512880 -1.5660417 -1.853988 -0.08854058 -0.03088575
Feb 2017 0.6873182 0.675079 -5.1712090 1.256181 1.97829177 -0.03088575
Mar 2017 4.4001741 -2.118636 -3.0813493 3.923298 -3.51113337 -0.03088575
Apr 2017 3.2083001 1.229573 -0.4375045 -1.114785 -2.99156972 -0.03088575
May 2017 5.7685229 9.970641 -7.2115563 1.863716 -1.11868543 -0.03088575
Jun 2017 -1.4123163 3.156754 3.7051396 -1.977690 1.81300581 -0.03088575
Unfortunately I no longer have access to the WRDS data. As of late November 2017 the script was running without any flaws.