Re: [R] bootstap and lme4

From: Douglas Bates <bates_at_stat.wisc.edu>
Date: Mon 09 May 2005 - 23:14:29 EST

FabbroThomas wrote:
> Hi,
>
> I am trying to get bootstrap confidence intervals on variance
> components and related statistics. To calculate the variance components
> I use the package lme4.
>

>> off.fun <- function(data, i){

> d <- data[i,]
> lme1<- lmer(y ~ trt + (trt-1|group), d)
> VarCorr(lme1)@reSumry$group[2,1] #just as an example
> }
>> off.boot <- boot(data=data.sim, statistic=off.fun, R=100)

>
> If I choose small values of R (<10) then I get very reasonable results
> but for large R I get the following error massage:
>
>
> *** malloc: vm_allocate(size=1069056) failed (error code=3)
> *** malloc[682]: error: Can't allocate region
> Error in .local(x, ...) : Calloc could not allocate (48 of 8) memory
>
>
> Can anyone tell me why I get this error massage and what I can do to
> avoid this problem?
>
> Thank you very much for your help!
>
> Thomas
>
>
>
> I am working with:
> R 2.1.0
> boot 1.2-22
> lme4 0.95-6
> Matrix 0.95-7
> lattice 0.11-6
> latticeExtra 0.1-1
>

Could you run

traceback()

after a failure and see where the failure is occurring?

This may not have an effect but you could avoid some of the assignments in your off.fun function. It should work to use

off.fun <- function(data, i) VarCorr(lmer(y ~ trt + (trt - 1|group), data, subset = i))@reSumry$group[2,1]

If that call to lmer doesn't work let me know please.



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon May 09 23:24:20 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:40 EST