# Analysis of count data (density per area) using Generalized linear model

We are applying a GzLM (using SPSS) for analysing the effects of two fixed categorical predictors (habitat type (2 levels) and seasons (4 leves), and their interaction, on data regarding counts per m2 (dv). Some samples have zeros, and we have detected overdispersion using a GzLM with Poisson error structure. We then proceed to use a negative binomial error distribution with log link, with a better fit of the model. My questions are:

(1) It is correct to run a GzLM for this kind of data where both predictors are categorical? We used to analyse this kind of data using GLM ANOVA with transformations (e.g. sqrt) but data is still non-normal, positive skewed.

(2) SPSS report the estimated marginal means and SE, it is ok to report these values in order to interpret the interaction?

• how many samples? reasonably balanced between habitats and seasons? max, mean counts? – Ben Bolker Feb 16 '16 at 13:51
• Hi Ben, we have a nearly balanced design (around 15-20) replicates for each combination of habitat and season. Max: 178, mean count: 16.1 – AnastD Feb 16 '16 at 14:28
• I correct myself, we have 30-37 replicates for each combination – AnastD Feb 16 '16 at 14:48

If you have categorical data the chances are that your dependent variable depends not only on each of the predictors but also on their combinations.

To put it simply, your current model looks like this (let's pretend it has only 2 predictors):

Y = b0 + b1*x1 + b2*x2 + e


However, the model below might be a better fit:

Y = b0 + b1*x1 + b2*x2 + b3*x1*x2 + e


Be aware that even with just a few predictors you might end up with too many combinations which in turn make your model unfeasible. But if you select only reasonable combinations you might get a model that fits much better to you data.