I would like to calculate Wald confidence intervals of the coefficients of a glm on a somewhat large data set, and use broom
for a tidy output.
mydata <- data.frame(y = rbinom(1e5,1,0.8),
x1 = rnorm(1e5),
x2 = rnorm(1e5))
glm.1 <- glm(y ~ x1 + x2, data = mydata, family = "binomial")
Using broom::tidy
takes a lot of time on large data, since it uses confint.glm
, which calculates the confidence intervals based on the profiled log-likelihood function.
tidy(glm.1, conf.int = TRUE) # can take literally hours