# predict whether respondent has a university degree
require(effects)
data(WVS)
logit.model <- glm(degree ~ religion + gender + age, data=WVS, family=binomial(link="logit"))
summary(logit.model)
# compute cluster-adjusted p-values
clust.p <- cluster.im(logit.model, WVS, ~ country, report = T, se = TRUE, drop = FALSE)
# compute 95% confidence intervals
ci.lo <- coefficients(logit.model) - qt(0.975, df=3)*clust.p$se
ci.hi <- coefficients(logit.model) + qt(0.975, df=3)*clust.p$se
ci <- cbind(ci.lo, ci.hi)
colnames(ci) <- c("95% lower bound", "95% upper bound")
ciRun the code above in your browser using DataLab