I have a data frame with 126 columns and want to run linear regressions over all columns. I did this with the lapply() function:
my_lms <- lapply(1:126, function(x) df[,x] ~ df$x1))
Again with the lapply() function I get the summary statistics:
lapply(my_lms, summary)
My question is how to get the same summary statistics using Newey-West errors?
I tried:
coeftest(my_lms, vcov. = NeweyWest)
but this gives me the error message:
Error in UseMethod("estfun") :
no applicable method for 'estfun' applied to an object of class "list"
Thanks
lapply(my_lms, coeftest, vcov. = NeweyWest)
? – Stéphane Laurent