Finite-Distributed-Model-in-R (About my code "FDL-totalData.R")
I use mulivariable dataset (I come across them in my summer internship as usual :P)
For every independent variable and dependent variable ,I build finite distributed lag model below
yt=α+β0xt+β1xt−1+...+βqxt−q+et
Finally you'll get result(contains variable name, lag, the smallest BIC and summary(fdl_model) ) in an excel sheet
If you want to try it by yourself (FDL.R build the model with "PoE" which is the open dataset)
About how to learn R in a smart way,
I highly recommand this website: https://bookdown.org/ccolonescu/RPoE4/