Created
April 16, 2018 10:02
-
-
Save timcdlucas/6ee0cd10cafe8a459bc3b0b03b469c0b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1 covariate and intercept | |
d <- as.matrix(data.frame(intercept = 1, x1 = rnorm(100))) | |
# Many responses | |
many_ys <- matrix(d[, 'x1'] * rep(0:10, each = 100) + rnorm(11 * 100, sd = 0.1), ncol = 11) | |
# Empty list to save our models into. | |
models <- list() | |
for(i in 1:11){ | |
models[[i]] <- glm.fit(d, many_ys[, i]) | |
} | |
models[[5]]$coefficients | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment