Hello everyone,

I have a question on how to calculate confidence intervals for predicted
proportions from a mixed effects logistic model with glmer. It's probably
very basic, but I'm at my wit's end. Below is a simplified reproducible
example. I have a single three-level categorical independent variable. The
method that I use (based on 1.96*SE) doesn't seem to work, because the
confidence intervals for significantly different effects overlap.

Here's the output of the code below:
             Est.   SE     z      P       BSum   ME     BlSum  BuSum
PSum   PlSum  PuSum
(Intercept)  2.21   0.60   3.69  <0.001   2.21   1.17   1.04   3.38
0.90   0.74   0.97
vision1     -2.41   0.91  -2.66   0.008  -0.20   1.78  -1.98   1.58
0.45   0.12   0.83
vision2     -1.11   0.97  -1.14   0.253   1.10   1.91  -0.81   3.00
0.75   0.31   0.95

As you can see, (Intercept) and vision1 CIs overlap -- for both cumulative
(sum) B and the resulting proportions. I killed a few weekends to try to
solve this problem and couldn't. Your help would be greatly appreciated.

Thanks,
--Egor

# preparing the data set:
# file URL: https://dl.dropboxusercontent.com/u/9147994/ds_seen.csv
inputDir = 'C:/Dropbox/Computer/Eclipse/R/HT/_input/'
inputFile = 'ds_seen.csv'
ds = read.csv(paste(inputDir, inputFile, sep=''), header=T)
ds$subject = as.factor(ds$subject)
ds$vision = as.factor(ds$vision)

# running the model:
library(lme4)
m = glmer(seen ~ vision + (1|subject), data = ds, family = 'binomial')
msum = as.data.frame(summary(m)$coefficients)

# calculating confidence intervals for the estimates:
msum$BSum[1] = msum$Estimate[1]
msum$BSum[2:3] = msum$Estimate[1] + msum$Estimate[2:3]
msum$ME = msum$`Std. Error` * 1.96 # margin of error
msum$BlSum = msum$BSum - msum$ME # lower bound on B sum
msum$BuSum = msum$BSum + msum$ME # upper bound on B sum
msum$PSum = plogis(msum$BSum) # predicted probability
msum$PlSum = plogis(msum$BlSum) # lower bound on predicted probability
msum$PuSum = plogis(msum$BuSum) # upper bound on predicted probability

	[[alternative HTML version deleted]]

