Solved – Warning message with non-integers in glmer

lme4-nlme

When I run:

model1 <- glmer(Avg_egg_mass ~ Treatment + Alt + Treatment:Alt + (1|Obs), family = poisson(link=log), data = dframe1)

the output is:

"There were 50 or more warnings (use warnings() to see the first 50)

warnings()
Warning messages: 1: In (function (fr, X, reTrms, family, nAGQ = 1L, verbose = 0L, … :non-integer x = 1.010000" and it goes on in this fashion for all my data in that column.

Do I have to make this an integer?

The summary of model2 then says:

"Error in diag(vcov(object, use.hessian = use.hessian)) :
error in evaluating the argument 'x' in selecting a method for function 'diag': Error in eigen(V.hess, symmetric = TRUE, only.values = TRUE) : infinite or missing values in 'x'"

Can anybody help?

Best Answer

Just for the sake of resolving the question, I'm going to state that this is probably due to a confusion over the modeling framework. It would rarely (if ever) be sensible to model an average egg mass with a Poisson distribution (which only applies to a unitless count variable). If you have average counts, and have a measurement of the total exposure (i.e. you have total counts and the area or time over which they were collected), you can do a Poisson model with an offset.

In this case it would make more sense to use a log-Normal (i.e., by transforming the response and then fitting a linear mixed model, lmer(log(Avg_egg_mass) ~ ...) or a Gamma model (the former, log-Normal approach is easier; I would generally only recommend a Gamma model in cases where there is a strong mechanistic or cultural reason to use one).

Related Question