[R] significance of random effects in poisson lmer

Greg Snow Greg.Snow at imail.org
Fri Aug 29 17:27:17 CEST 2008

The key line in the error message is: "Update not yet written".

The lme4 package and functions in it are a work in progress, Dr. Bates is doing a great job on getting parts done and is making the parts that are done available for people to use, test, and comment on, but he only has so much time.  He has some functions in place as place holders to show what will happen some day, but the function you want (for the type of analysis you want) is one of those that has not been written yet.

What can you do? Here are a couple of suggestions:

1. be patient and wait for this code to be written (I think it is still down the list a ways, so this will not be a short wait).

2. Write the code yourself and submit it for inclusion.

3. Give Dr. Bates a huge sum of Money so that he can spend more time working on writing the function(s) you need/want.

4. See if another existing tool will do what you want (there are some other tools in R that address specific types of glmms, one may fit your situation, or you could switch to a Bayesian Hierarchical model).

5. Find a way to distort the space-time continuum so that Dr. Bates can program thousands of hours while the rest of us experience only a few minutes.

6. Ask yourself if you really need to test the significance of the random effects or can you just go with the estimate of them and focus on answering other questions.

7. Invent a time machine, go forward in time and get the completed code and bring it back (or it may be easier to create a time machine that can only send data through time and use it to download the lme4 package from a future CRAN).

8. Explore your data and the theory behind it to decide if the normal approximation to the poisson is good enough to answer your question, and if it is, then use the normal approximation (that part is working).

There may be others,

This probably is not as helpful as you hoped, but hopefully at least will stop you from trying things that won't work for a while.

Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
(801) 408-8111

> -----Original Message-----
> From: r-help-bounces at r-project.org
> [mailto:r-help-bounces at r-project.org] On Behalf Of Wilson, Mark
> Sent: Friday, August 29, 2008 5:23 AM
> To: r-help at r-project.org
> Subject: [R] significance of random effects in poisson lmer
> Hi,
> I am having problems trying to assess the significance of
> random terms in a generalized linear mixed model using lme4
> package. The model describes bird species richness R along
> roads (offset by log length of road log_length) as a function
> of fixed effects Shrub (%shrub cover) and Width (width of
> road), and random effect Site (nested within Site Cluster).
> >From reading answers to previous posts, it seems that the
> consensus is
> to derive p-values using the neat little piece of code posted
> by Doug Bates as "mcmcpvalue". This code calls the merMCMC
> object created by the function mcmcsamp, but I can't even get
> as far as using this function without running into
> difficulty. Basically, I get an error message saying "Error
> in .local(object, n, verbose, ...) : Update not yet written"
> - see below for complete code.
> Does anyone know why I am getting this error message and what
> if anything I can do to address the problem? I am aware that
> p-values derived via MCMC in this way can problematic when
> used with models that incorporate offsets. However, I get the
> same error message if I take the offset out of the model. The
> only way I can get mcmcsamp to run is to leave out the
> specification of the model as poisson. However, I'm pretty
> sure I don't want to do this.
> Provided someone can tell me what I'm doing wrong, and I am
> able to generate my MCMC sample, are there any work-arounds
> the problems people have encountered using mcmcpvalue on
> models with offsets? Could I control for the effect of road
> length on bird species richness by using residuals from the
> relationship between the R and log_length as my response
> variable? If not, then how can one estimate the significance
> values of random effects of lmer models with offsets?
> Very grateful for any suggestions,
> Mark
> >
> model<-lmer(R~Shrub+width+(1|Cluster/Site)+offset(log_length),
> family=poi
> sson)
> > summary(model)
> Generalized linear mixed model fit by the Laplace approximation
> Formula: R ~ Shrub + width + (1 | Cluster/Site) + offset(log_length)
>    AIC   BIC logLik deviance
>  59.76 70.56 -24.88    49.76
> Random effects:
>  Groups       Name        Variance Std.Dev.
>  Site:Cluster (Intercept)  2.9878e-12 1.7285e-06
>  Cluster      (Intercept) 0.0000e+00 0.0000e+00
> Number of obs: 64, groups: Site:Cluster, 12; Cluster, 2
> Fixed effects:
>              Estimate Std. Error z value Pr(>|z|)
> (Intercept) -3.908504   0.198535 -19.687  < 2e-16 ***
> Shrub        0.016509   0.004355   3.791 0.000150 ***
> width       -0.016435   0.009779  -1.681 0.092812 .
> ---
> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
> Correlation of Fixed Effects:
>       (Intr) Shrub
> Shrub -0.040
> width -0.881 -0.322
> > samp<-mcmcsamp(model,50000)
> Error in .local(object, n, verbose, ...) : Update not yet written
> >
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list