# [R] Bootstrap ICC estimate with nested data

Andrew Robinson andrewr at uidaho.edu
Tue Sep 21 16:12:37 CEST 2004

```Paul,

I think that you should account for the group structure.

My reading of Davison and Hinkley "Bootstrap Methods and their
Application" (1997, p. 100) suggests that for balanced data structures
with more than, say, 10 clusters, one should apply the bootstrap to
the clusters, but not within the clusters.  They provide some further
notes that you might find useful.

I hope that this helps.

Andrew

On Tue, Sep 21, 2004 at 03:41:29PM +0200, Bliese, Paul D MAJ USAMH wrote:
> I would appreciate some thoughts on using the bootstrap functions in the
> library "bootstrap" to estimate confidence intervals of ICC values
> calculated in lme.
>
> In lme, the ICC is calculated as tau/(tau+sigma-squared).  So, for instance
> the ICC in the following example is 0.116:
>
> > tmod<-lme(CINISMO~1,random=~1|IDGRUP,data=TDAT)
> > VarCorr(tmod)
> IDGRUP = pdLogChol(1)
>             Variance  StdDev
> (Intercept) 0.1829931 0.427777
> Residual    1.3907732 1.179310
> > 0.18299/(0.18299+1.39077)
> [1] 0.1162757
>
> Using the bootstrap library, I can set up theta to do the ICC as follows:
>
> >theta<-function(x,DATA){tmod<-lme(CINISMO~1,random=~1|IDGRUP,data=DATA[x,])
> OUT<-as.numeric(VarCorr(tmod)[[1]])/(as.numeric(VarCorr(tmod)[[1]])+as.numer
> ic(VarCorr(tmod)[[2]]))
> return(OUT)}
>
> Finally, I can run the bootstrap-t confidence limit function (or other
> functions) as follows:
>
> > bootout<-boott(1:nrow(TDAT),100,theta,data=TDAT)
>
> This seems to work, but the estimates also seem strange.  For intance, the
> observed ICC value is larger than the 95% confidence intervals provided by
> the bootstrap.  It occurs to me that the results might be strange because
> the sampling with replacement is being done without regard to group
> membership.  That is, I might select individual 1 from group 1 10 times
> (even though in the sample the group only has 5 members), and I might not
> select any individuals from group 2.
>
> My fundamental question is:  "What are people's thoughts about using
> bootstaping in nested data?  Does one have to sample with replacement taking
> into consideration the group structure in the data?"  If so, any suggestions
> on how to do this?
>
>
> Paul Bliese
> US Army Medical Research Unit - Europe
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help

--
Andrew Robinson                      Ph: 208 885 7115
Department of Forest Resources       Fa: 208 885 6226
University of Idaho                  E : andrewr at uidaho.edu
PO Box 441133                        W : http://www.uidaho.edu/~andrewr
Moscow ID 83843                      Or: http://www.biometrics.uidaho.edu
No statement above necessarily represents my employer's opinion.

----- End forwarded message -----

--
Andrew Robinson                      Ph: 208 885 7115
Department of Forest Resources       Fa: 208 885 6226
University of Idaho                  E : andrewr at uidaho.edu
PO Box 441133                        W : http://www.uidaho.edu/~andrewr
Moscow ID 83843                      Or: http://www.biometrics.uidaho.edu
No statement above necessarily represents my employer's opinion.

```