I'm comfortable with simple linear models and GLMs but I've never used either for multivariate analysis. My data is counts of three developmental stages of an insect, over time, in randomized complete blocks, with 3 treatments + no treatment control.

My count data is non-normal (zeroes omitted for easier visualization)...

... and over-dispersed:

                    egg                 l.nymph                 s.nymph 
"M (SD) = 9.08 (26.11)"  "M (SD) = 0.56 (2.28)"  "M (SD) = 1.04 (3.78)" 

and treatment B seems to have a pretty good effect in reducing counts! ...

I figured I'd model the data using a negative binomial GLM... but I'm just not really sure how one would set that up or interpret the results. Given the variables (response = count; explanatory = treatment, developmental stage, sample date, block), would my model be additive? Multiplicative? And is the coefficient and significance output in the nbGLM summary sufficient for my analyis?

  • $\begingroup$ looking at the graph i see a decreasing count. have you considered fitting a poison model? probably truncated since you do not have the zeros? $\endgroup$
    – Onyambu
    Jul 28, 2020 at 20:59
  • 1
    $\begingroup$ something like glmmTMB(response ~ treat*stage*date + (treat*stage|block), family=nbinom2, data= ...) might be good as a start. It will be a little tricky to model and interpret the full three-way (treatstagedate) interaction. Can you start by simplifying, e.g. just model the peak or the endpoint or the mean of each treat*stage combo? This could be done with GAMs but would get more complicated ... rpubs.com/bbolker/ratgrowthcurves $\endgroup$
    – Ben Bolker
    Jul 29, 2020 at 2:15
  • $\begingroup$ Are the three stages examined separately, or is this in some way following a progression from stage to stage? From the plots it seems like the latter (nymphs go up as eggs go down), which would require different analysis from the former. If sequential, is there a progression from small nymphs to large nymphs or are there 2 different fates of the eggs? $\endgroup$
    – EdM
    Jul 29, 2020 at 20:49
  • $\begingroup$ I think it might be easiest and make more sense to analyse the egg and nymph data separately. I'm not a huge fan of log transforming my counts in an attempt to reach normality, and I'm unsure of how to evaluate longitudinal data using a GLM. $\endgroup$ Jul 29, 2020 at 22:34

1 Answer 1


If you are willing to model the nymph data separately, a log link in a GLMM that models counts as a function of time provides one approach. Then the coefficient for time is the time constant for an exponential growth, which might work OK for the nymph values. Treating blocks, etc., as random effects covers the longitudinal aspect of the data. See this answer for an example that I just posted for exponential decay in an observational study. In that case proper specification of the random effects seems to have removed over-dispersion problems seen in simpler models, allowing a reasonable Poisson fit.

  • $\begingroup$ Okay, I'll give this a try. Thanks for the suggestion. Negative binomial would be suitable to deal with the overdispersion too, correct? $\endgroup$ Aug 6, 2020 at 3:04
  • 1
    $\begingroup$ @DieterKahl besides negative binomial: quasi-Poisson, zero-inflated Poisson, or hurdle models also might help. But see what happens with well thought through random effects in a Poisson model first. $\endgroup$
    – EdM
    Aug 6, 2020 at 11:28
  • $\begingroup$ This reply is a bit late as haven't visited this data since the summer due to other priorities. After recently working with mixed models, I am convinced it is a great option, as you said. How does one specify the random effect structure for the grouping factor "block" if it's a Latin square (4x4)? If counts were taken on each date from new leaves but from constant subject plants, do subjects have to be specified? It feels incorrect to use count ~ time * treatment + (1|block) which produces Number of obs: 2240, groups: block, 4 $\endgroup$ Dec 8, 2020 at 7:24
  • 1
    $\begingroup$ @DieterKahl you need to account for any internal correlations in the data, so if you have repeated measurements on the same plants then plants need to be specified as random effects. For the 4x4 Latin square design, you could consider using row and column as random effects or just treat all 4x4=16 blocks in the square as a random effect. Either way, make sure that the data are coded in a way that the grouping of plants within blocks is understood; if you give each plant a separate ID, the software should figure that out. $\endgroup$
    – EdM
    Dec 8, 2020 at 15:27
  • $\begingroup$ Sounds good, thank you! $\endgroup$ Dec 8, 2020 at 20:11

Your Answer

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

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