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@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.

Reply via email to