Skip to content
Prev 14644 / 20628 Next

lmer confint() bootstrap doesn't match fitted values when weighted

Dear masters,
I found a strange behaviour in confint() bootstrap methods, maybe 
something with my data, I don't know.

My data is weighted and is something related to it, as you can see in 
code below.

Best,
Rodrigo


## run
## strange behaviour of confint()
#
# R version: 3.3.1
# lme4 version: 1.1-12

require(lme4)

dd=read.csv2(file("http://topicostropicais.net/bau/data.csv"))

m1<-lmer(NOTA~(1|ID_ESCOLA)+(1|ID_TURMA),data=dd,weights=PESO)

## pre conditions seems to be OK
plot(m1)
qqnorm(scale(resid(m1)),ylab="Residual quantiles",col="orange")
qqline(scale(resid(m1)),col="blue")

## reproducing error
VarCorr(m1) # Residual = 46.5197
# with "boot", sigma intervals doesn't match the estimated value 46.5197
confint(m1,method="boot",boot.type="norm")
confint(m1,method="boot",boot.type="basic")
confint(m1,method="boot",boot.type="perc")

## cause seems to be 'weigths'
m2<-lmer(NOTA~(1|ID_ESCOLA)+(1|ID_TURMA),data=dd)
VarCorr(m2)
confint(m2,method="boot")
confint(m2,method="profile")