1
$\begingroup$

What is not right with a model that produces this kind of residual plot? Does it have to be discarded?

My data is egg production (counts, but cumulative) over a period of 55 days for 7 treatments+control with 10 replicates each

There are repeat measurements of the same individuals done over several days, and this is accounted for in the random factors, using a glmm model with family set to Poisson distribution. Dependent variable is discrete, the three fixed factors are categorical with 2 levels:

m1 <- glmer(n_cumulative ~ Pyrene*Temp*pH + (Days|ID), family = poisson, data = egg_production)

Residual plot

$\endgroup$
8
  • 3
    $\begingroup$ It's less relevant what model that is than what data it is. There seems to be cyclicity, or seasonality, with a period of almost 100. A pattern like this could happen if you look at quarter-hour-bucketed data with daily seasonality ($24\times 4=96$ buckets per day) but do not model that seasonality. So: what is your data? $\endgroup$ Commented Mar 9, 2023 at 10:44
  • $\begingroup$ Thank you. My data is egg production (counts, but cumulative) over a period of 55 days for 8 treatments with 10 replicates each. I can edit this into the question $\endgroup$
    – kirchoffs
    Commented Mar 9, 2023 at 10:48
  • 1
    $\begingroup$ (1) Modeling cumulative data is hard. Any particular reason why you are not modeling the underlying counts? (2) It seems your data are ordered in some specific way. That is good in your case, because it pointed you towards a problem in your data. (3) Putting the two together, if you analyze cumulative data over time, you should definitely see a linear trend by Day (i.e., every day, the cumulative count increases by that day's production, so on average by the average production), which you should account for in your data as a fixed effect, not only random. $\endgroup$ Commented Mar 9, 2023 at 10:53
  • $\begingroup$ Well, I was advised to do it this way, but I don't understand exactly why. Modelling the underlying counts also produces a zigzag-ed residual plot, but much weaker. It makes a lot of sense that I should account for the increase by Day as a fixed effect though. $\endgroup$
    – kirchoffs
    Commented Mar 9, 2023 at 11:07
  • 1
    $\begingroup$ It's usually a good idea to plot residuals against predictors (in this case, especially days) to identify unmodeled patterns, rather than against arbitrary indices. $\endgroup$ Commented Mar 9, 2023 at 11:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.