[R] lme4 package and gamma family

Ben Bolker bolker at ufl.edu
Tue Feb 2 22:30:57 CET 2010


cristina <cristinaaponte <at> gmail.com> writes:

> 
> 
> Hello, 
> 
> I am trying to use the lmer function from the lme4 package I have installed
> today (lme4_0.999375-32.zip; R-2.10.1). According to the information, I
> should be able to use a generalized linear mixed model. 
> However when I try to fit a model with Gamma distribution of the errors, it
> gives me the following error 
> 
> model1<-lmer(Cmic~1+(1|FOREST/DEPTH),data=DATOS,family=Gamma)
> Error en mer_finalize(ans) :
>   General form of glmer_linkinv not yet written
> 
> The same occurs with the function glmer, although I have seen in the forum
> that other people has been able to implement this type of models. 
> 
> Does anyone know why is this happening?
> 
> Thanks!
> Cristina
> 
> IRNAS-CSIC
> Seville, Spain
> 

  I am surprised that other people have been able to implement this type of
model, since it does *not* appear that the inverse link (which is the default
link for the Gamma family) is currently implemented, although the lme4 package
has been through so many changes that it may once have had it. It is "fairly
easy" to patch (i.e. if you are capable of downloading the source code, writing
a few lines of C code, and building the new package) -- but that doesn't
necessarily mean that it is easy for you.  I've sent in a patch for this case --
if the package author (Doug Bates) accepts it, you might be able to install a
development version of the package from r-forge in a day or two that has this
capability.

  It would probably be best to send follow-up questions of this type to
r-sig-mixed-models at r-project.org



More information about the R-help mailing list