# Poisson Repeated Measures ANOVA

The following is a general background into my data analysis problem:

• I am working with count data that is non-normal.
• Data was collected at 2 time periods.
• I am interested in comparisons of species counts between treatments.
• There are 4 treatments.

Data were initially analyzed using the Kruskal-Wallis rank sum test (a non-parametric ANOVA counterpart). A reviewer of my manuscript suggested using a Poisson distribution. How can I perform a repeated measures ANOVA with a Poisson distribution in R?

• You can use a multilevel or mixed model. What software do you use? – Jeremy Miles May 2 '13 at 0:06

## 1 Answer

I guess my comments have become so extensive that I should call them an answer.

If it's a situation where you want fixed effects, you can do it with a Poisson glm just as you can do ANOVA via lm. If you want a mixed model (glmm), you could use lme4 (such as the function glmer), though there are other suitable packages (see below).

If you do want a fixed effects model, like an ANOVA but with Poisson data (and I am not saying that's what you should do, just that it sounds like what you're asking for), for factors you can literally just use exactly the same command in glm as in lm, but with an additional argument of family=poisson.

Compare: summary(lm(count~spray,data=InsectSprays))
with summary(glm(count~spray,family=poisson,data=InsectSprays))

The anova command can even be used to compare glms as it is used for lms. The if the null is true and the Poisson assumption holds, the deviance for the difference should be chi-square with the indicated d.f., but fully understanding even basic use of glms would require a textbook.

For packages that do glmms and their features, here