2
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ In general it wouldn't seem sensible to model an average egg mass with a Poisson distribution (which only applies to a unitless count variable). Perhaps you intended to use a log-Normal (lmer(log(Avg_egg_mass) ~ ...) or a Gamma model? $\endgroup$ – Ben Bolker Oct 9 '14 at 13:35
  • $\begingroup$ Yes thanks, I just noticed that and changed it back to gaussian - the error message has now disappeared. Now I get this instead "Error in checkNlevels(reTrms$flist, n = n, control) : number of levels of each grouping factor must be < number of observations" Any ideas? $\endgroup$ – Aisha Oct 9 '14 at 13:55
  • $\begingroup$ that's because you shouldn't (generally) use an observation-level random effect with a Gaussian -- it's confounded with the residual error term. If that was your only grouping variable, then you don't even really need a mixed model $\endgroup$ – Ben Bolker Oct 9 '14 at 14:09
  • $\begingroup$ Thanks alot! It works when I leave that variable away and add a different random effect with a lesser number of levels. $\endgroup$ – Aisha Oct 9 '14 at 14:37
2
$\begingroup$

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.