I am running multiple univariate regressions, like in this reproducible example:
require(dynlm)
data(USeconomic)
US<-USeconomic
vars<-colnames(US)[-2]
a<
Here is an approach using plyr
library(plyr); library(dynlm); library(tseries)
# FUNCTION TO RUN A SINGLE REGRESSION
foo = function(x, l) dynlm(log(GNP) ~ L(get(as.character(x)), l), data = US)
# CREATE PARAMETER GRID
params = expand.grid(x = colnames(US)[-2], l = c(0, 1, 4))
# RUN REGRESSIONS
regressions = mlply(params, foo)
Each element of this list contains details on a single regression from which you can extract your desired output