I have two xts datasets. Each containing 50 variables. One is dependent variables dataset other one is independent variables dataset. I want to apply multiple regression models, i.e. one variable from each data set. But does not get desired results. Many values are missing. I want to extract coefficients from each regression along with t and p values.
library(xts)
library(zoo)
library(PerformanceAnalytics)
dep_var<-managers[,c(1,3)]
ind_var<-managers[,c(8,9)]
## individually running each model
model1<-lm(dep_var[,1]~ind_var[,1])
model2<-lm(dep_var[,2]~ind_var[,2])
summary(model1)
summary(model2)
models<-lapply(dep_var,function(x) lm(x[i]~ind_var[i]))
lapply(1:3,function(i) lm(dep_var[,i]~ind_var[,i]))
– StupidWolf