Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.LNX.4.64.1206170915370.32392@orpheus.qimr.edu.au>
Date: 2012-06-16T23:47:41Z
From: David Duffy
Subject: Bootstrapping glmer random effects
In-Reply-To: <1339762828.9973.YahooMailNeo@web114501.mail.gq1.yahoo.com>

On Fri, 15 Jun 2012, Joe King wrote:

> Dear all
>
> I am attempting to obtain a bootstrap confidence interval for the random 
> effect in a simple (random intercept) model using glmer.
>
> The problem I have is that the interval I obtain consistently does not 
> contain the value I am trying to get an interval for !
>
> There are no missing data. This is the code I have used to obtain the interval:
>
> for (i in 1:k) {
>   sam <- dt[sample(nrow(dt), replace=T, size=nrow(dt)), ]
>   m1<- glmer(wg~(1|city), data=sam, family=binomial)
>   bs[i] <- VarCorr(m1)$city[1]
> }
> quantile(bs,c(0.025,0.975))
>
> Could anyone suggest why this is happening, and what I might be able to do about it ?

Have a look at how it is done by glmmML's glmmboot (or by merboot).  Your 
resampling has to correctly mimic the mechanism by which your 
data are generated.  I liked Shao J, Tu D (1995): The jackknife and 
bootstrap.