I am currently working on my PhD thesis and was wondering how I can identify the optimal number of lags for the Newey West covariance matrix. So far, my code is
library(sandwich) library(lmtest) library(dynlm) Regression <- dynlm(y ~ x) coeftest(Regression, vcov = NeweyWest(Regression, lag = NULL))
Since I have to compare coefficients of multiple regressions (for the same time series), I should use the same lag as well. However is there a rule of thumb or a simple method to get the lag?
Thank you and best regards