Computation of confidence intervals for odds ratios of a glm
object is straight forward:
mydata <- read.csv("http://www.ats.ucla.edu/stat/data/binary.csv")
# set up logistic model
mylogit <- glm(admit ~ gre + gpa + rank, data = mydata, family = "binomial")
# calc odds ratios and confidence intervals
exp(cbind(OR = coef(mylogit), confint(mylogit)))
However, the same approach does not work on glmmPQL
objects (with random effects) returned by MASS:glmmPQL()
.
MWE from glmmPQL() help:
library(nlme) # will be loaded automatically if omitted
mylogit <- summary(glmmPQL(y ~ trt + I(week > 2), random = ~ 1 | ID,
+ family = binomial, data = bacteria))
exp(cbind(OR = coef(mylogit), confint(mylogit)))
Manually computing the confidence intervals (coefficient + 2* Std. Error) using the coefficients of the summary output also failed for me as I could not find them in the summary object (but they are there when printing the summary to console). Taking them out manually is no longterm approach...
How does this work efficiently for glmmPQL
objects?