[R] using glmer to fit a mixed-effects model with gamma-distributed response variable

From: Benjamin Caldwell <btcaldwell_at_berkeley.edu>
Date: Fri, 13 May 2011 15:01:54 -0700


Sub: using glmer to fit a mixed-effects model with gamma-distributed response variable

Hello,
I'm currently trying to fit a mixed effects model , i.e.:

> burnedmodel1.2<-glmer(gpost.f.crwn.length~lg.shigo.av+dbh+leaf.area+
bark.thick.bh+ht.any+ht.alive+(1|site/transect/plot), family=gaussian, na.action=na.omit, data=rws30.BL)

If I run this code, I get the error below:

Error: length(f1) == length(f2) is not TRUE In addition: Warning messages:
1: In plot:(transect:site) :
  numerical expression has 175 elements: only the first used 2: In plot:(transect:site) :
  numerical expression has 175 elements: only the first used

Someone on this forum made the following suggestion,

> rws30.BL$site <- factor(rws30.BL$site)
> rws30.BL$transect <- interaction(rws30.BL$site, rws30.BL$transect, drop =
TRUE)
> rws30.BL$plot <- interaction(rws30.BL$site, rws30.BL$transect,
rws30.BL$plot, drop = TRUE)

Which once run allows the above code to run for a gaussian family. However, if I try to fit a gamma family model (my goal), i.e.

> burnedmodel1.2<-glmer(gpost.f.crwn.length~lg.shigo.av+dbh+leaf.area+
bark.thick.bh+ht.any+ht.alive+(1|site/transect/plot), family=Gamma, na.action=na.omit, data=rws30.BL)

I get:
Error: no valid set of coefficients has been found: please supply starting values
In addition: Warning message:
In log(ifelse(y == 0, 1, y/mu)) : NaNs produced

How do I determine what reasonable starting values are? And what's up with the NaNs?

Thanks for taking a look.

*Ben Caldwell*

PhD Candidate
University of California, Berkeley

        [[alternative HTML version deleted]]



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. Received on Fri 13 May 2011 - 22:07:58 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 18 May 2011 - 00:00:07 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive