Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

confint(...,method="boot") for model with weights #386

Open
bbolker opened this Issue Jun 30, 2016 · 2 comments

Comments

Projects
None yet
2 participants
Owner

bbolker commented Jun 30, 2016

From Rodrigo Travitzki via r-sig-mixed-models ...

## 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") 

@bbolker bbolker added a commit that referenced this issue Jul 1, 2016

@bbolker bbolker oops, that should be issue #386 a9fd5a2
Owner

bbolker commented Jul 1, 2016

adding to this: zero-weight observations are not taken into account when computing sigma() in general. This should be fixed or at least noted in documentation.

Exploration so far posted at https://github.com/lme4/lme4/blob/master/misc/issues/GH386.R ...

Owner

mmaechler commented Jul 1, 2016

We definitely should behave as lm() here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment