Currently going through the VAR section of the "Econometrics with R" online TB (https://www.econometrics-with-r.org/16.1-vector-autoregressions.html) but I am encountering an error.
I run the exact same code up to and including:
VAR_EQ1 <- dynlm(GDPGrowth ~ L(GDPGrowth, 1:2), + L(TSpread, 1:2), start = c(1981, 1), end = c(2012,4))
But get thrown the error:
" Error in L(TSpread, 1:2) : could not find function "L" "
As far as I am aware the L() function comes with the package "dynlm" which I have installed.
Can anyone help with this?