This repo contains data and R code related to my medium article "Custom Factor Models - Build your own in R with a few lines of codes" https://charlesmalafosse.medium.com/custom-factor-models-build-your-own-in-r-with-a-few-lines-of-codes-502274ae3624
Become a member on Medium and support my work (affiliate link): https://medium.com/@charlesmalafosse/membership
Multi-factor models are a must-have for investors looking to understand their portfolio's performance drivers. It helps explain the actual return of factors such as countries, sectors, and styles, independent of other factors' effects.
The article is a step-by-step guide to build your own equity factor model using R and cross-sectional regressions.In this article, we focus on the mechanics of such models, and how to code them in R. We also introduce a visualization that lets you visualize the factor performance contributions overtime.