Need help: Visualising Rolling Regression


#1

I am relatively new to R and i have been trying to create something similar to the following . See https://rviews.rstudio.com/2018/05/10/rolling-fama-french/. I am struggling to chart each of the rolling factor betas as shown in the above link. I cant seem to extract them from the rolling regression function and its not possible to just plot Asset_reg. Any help would be welcomed.

Code below:

Rolling Regression

rolling_lm <- rollify(.f = function(Asset, Growth, Value, Momentum, Size, 
ERP) {
lm(Asset ~ Growth + Value + Momentum + Size + ERP)
}, 
window = 36, 
unlist = FALSE)

Asset_reg <- (roll_lm = rolling_lm(Asset,Growth, Value, Momentum, Size, 
ERP))