How to Perform Rolling Regression in R
HTML-код
- Опубликовано: 21 авг 2024
- In this video we discuss how to estimate beta using rolling regression I..e to perform rolling regression in R. We have used two packages i.e. the broom package and the slider package. The broom package have a function called rollapply and the slider package have different functions but the one we used is slider_period.
Download do and exercise file:
payhip.com/b/x...
Website: thedatahall.com
As an Amazon Associate, I earn from qualifying purchases.
can you share the complete code?
Thanks for identifying. I have added it in the description.
If you group_by the stock, would that prevent you from needing to run it in a loop? Or would these not recognize the grouping?
I am new in working with R, so you might correct me but I was not able to get it working by grouping for stocks. Maybe @The Data Hall can demonstrate how to use rolling regression on more then 1 company with multiple Facots like HML, SMB and Mkt-Rf on a month base.
@frankmeier7595 you can email me your data and code i will look into it