I feel that I am just little bit off with my code but cannot figure out how to make it work. I am trying to use all the columns in one data frame as an independent variable and all the columns in another as dependent (to run multiple single variable models) I'll greatly appreciate any suggestions.
A <- as.data.frame( matrix(rnorm(1:(250*4)), ncol = 4) )
colnames(a) <- paste0("A", 1:ncol(a))
B <- as.data.frame( matrix(rnorm(1:(250*6)), ncol = 6) )
model_<-list()
results_<-list()
for (i in 1:ncol(A)){
for (j in 1:ncol(B)){
model_<-glm(A[,i]~B[,j], family=quasipoisson){
results_<-lapply(model_, function(x) anova(x, test="F"))
}
}
}