[R-sig-ME] Testing signif. of random effects by bootstrapping

David Duffy David.Duffy at qimr.edu.au
Sun Mar 7 02:21:25 CET 2010


On Sat, 6 Mar 2010, Luciano La Sala wrote:

> 2. The bootstrap method yields p-values that are either 0 or 1 (no decimal
> places), which seems a little odd to me. How can I ask R to provide, say, 4
> significant digits for the bootstrapping p-value?
>
> NOW THE BOOTSTRAPPING APPROACH
>
> y <- simulate(REDUCED)
> lrstat <- numeric(1000)
> for(i in 1:1000){
>    y <- unlist(simulate(REDUCED))
>    REDUCED <- lm(TMT10~HatchOrder+ClutchSize+Year+
>                  HatchOrder*Year+ClutchSize*Year+SibComp)
>   FULL <- lmer(TMT10~HatchOrder+ClutchSize+Year+HatchOrder*Year+>
        ClutchSize*Year+SibComp+(1|NestID))
>  lrstat[i] <- as.numeric(2*(logLik(FULL)-logLik(REDUCED)))
> }

y never gets used in your loop, so lrstat[1:1000] is all 28.0247. But this 
isn't a bootstrap anyway.  You should look at the RLRsim package and 
associated paper.

-- 
| David Duffy (MBBS PhD)                                         ,-_|\
| email: davidD at qimr.edu.au  ph: INT+61+7+3362-0217 fax: -0101  /     *
| Epidemiology Unit, Queensland Institute of Medical Research   \_,-._/
| 300 Herston Rd, Brisbane, Queensland 4029, Australia  GPG 4D0B994A v




More information about the R-sig-mixed-models mailing list