I\'m trying to run multiple logistic regression analyses for each of ~400k predictor variables. I would like to capture the outputs of each run into a row/column of an outpu
It will be faster if you use apply instead of a for loop:
apply
for
t(apply(mydatamatrix, 2, function(x) coef(summary(glm(mydataframe$O1 ~ x + as.factor(mydataframe$P2), family=binomial)))[2, 1:4]))