# How to decide which glm family to use?

I have fish density data that I am trying to compare between several different collection techniques, the data has lots of zeros, and the histogram looks vaugley appropriate for a poisson distribution except that, as densities, it is not integer data. I am relatively new to GLMs and have spent the last several days looking online for how to tell which distribution to use but have failed utterly in finding any resources that help make this decision. A sample histogram of the data looks like the following:

I have no idea how to go about deciding on the appropriate family to use for the GLM. If anyone has any advice or could give me a resource I should check out, that would be fantastic.

• What exactly is "fish density"? Is it a number of fish per unit volume of lake, eg? Jan 15, 2016 at 0:05
• It's number of fish per unit area (in this case square meters). We used visual survey tools, so it's calculated by the number of fish observed divided by the area surveyed by the tool. We had to use density to standardize between the tools because they survey very different amounts of area, otherwise I could just use count data and stick with a poisson distribution. Jan 15, 2016 at 0:10
• My advice -- go back to the count data and use the "area" as an offset in a model with a log link --- but I don't know that the Poisson will fit very well (it's a bit hard to guess since your histogram is only showing the marginal distribution rather than the conditional distributions that the GLM would be modelling ... and in any case has far too few bins to be much use). If the Poisson isn't heavy-tailed / spike-at-0-ish enough, a negative binomial might work, or you might need zero-inflated or hurdle models Jan 15, 2016 at 2:26
• I do Poisson modeling all-day-every-day and Glen_b's comment is the canonical answer.
– Paul
Sep 18, 2017 at 17:02
• One addendum - Poisson modeling is theoretically well-justified when the units of observation (in this case, I'm guessing you count individual fish?) are independently distributed across the field of observation, like randomly strewn grains of sand. Under this assumption there may be some variation in the density, but one fish's position does not imply anything about the positions of other fish. But be warned this assumption may be violated in practice because fish do cluster, for example into schools, and then their positions are no longer independent.
– Paul
Sep 18, 2017 at 17:07

GLM families comprise a link function as well as a mean-variance relationship. For Poisson GLMs, the link function is a log, and the mean-variance relationship is the identity. Despite the warnings that most statistical software gives you, it's completely reasonable to model a relationship in continuous data in which the relationship between two variables is linear on the log scale, and the variance increases in accordance with the mean.

This, essentially, is the rationale for choosing the link and variance function in a GLM. Of course, there are several assumptions behind this process. You can make a more robust model by using quasilikelihood (see ?quasipoisson) or robust standard errors (see package sandwich or gee).

You have correctly noted that many densities are 0 in your data. Under Poisson probability models, it is appropriate to occasionally sample 0s in the data, so it's not necessarily the case that these observations are leading to bias in your estimates of rates.

To inspect the assumptions behind GLMs, it is usually helpful to look at the Pearson residuals. These account for the mean variance relationship and show the statistician whether particular observations, such as these 0s, are egregiously affecting estimation and results.

Generalized linear model is defined in terms of linear predictor

$$\eta = \boldsymbol{X} \beta$$

that is passed through the link function $g$:

$$g(E(Y\,|\,\boldsymbol{X})) = \eta$$

It models the relation between the dependent variable $Y$ and independent variables $\boldsymbol{X} = X_1,X_2,\dots,X_k$. More precisely, it models a conditional expectation of $Y$ given $\boldsymbol{X}$,

$$E(Y\,|\,\boldsymbol{X} ) = \mu = g^{-1}(\eta)$$

so the model can be defined in probabilistic terms as

$$Y\,|\,\boldsymbol{X} \sim f(\mu, \sigma^2)$$

where $f$ is a probability distribution of the exponential family. So first thing to notice is that $f$ is not the distribution of $Y$, but $Y$ follows it conditionally on $\boldsymbol{X}$. The choice of this distribution depends on your knowledge (what you can assume) about the relation between $Y$ and $\boldsymbol{X}$. So anywhere you read about the distribution, what is meant is the conditional distribution.

On another hand, in practice, if you are interested in building a predictive model, you may be interested in testing few different distributions, and in the end learn that one of them gives you more accurate results then the others even if it is not the most "appropriate" in terms of theoretical considerations (e.g. in theory you should use Poisson, but in practice standard linear regression works best for your data).

• This answer should be the accepted one. Thanks! Nov 2, 2022 at 13:31

This is a somewhat broad question, you are asking for how to do modelling, and there are entire books dedicated to that. For example, when dealing with count data, consider the following:

In addition to choosing a distribution, you have to choose a link function. With count data you could try poisson or negative binomial distribution, and log link function. A reason for the log link is given here: Goodness of fit and which model to choose linear regression or Poisson If your patches have very different areas, maybe you should include logarithm of area as an offset, to model counts per unit area and not absolute counts. For an explication of offset in count data regression, see When to use an offset in a Poisson regression?

EDIT


This answer was originally posted to another question, which was merged with this one. While the answer is general, it commented specifics of a data set and problem which no more are in the question. The original question can be found in the following link: Family in GLM - how to choose the right one?

• We can't unmerge the questions, @kjetil, only the devs can do that (& they really don't like to). I can still access the original Q, though. 1 possibility is that I could copy the content into a new Q (which would be authored by me), you could copy this A to the new thread, & then I could close that thread as a duplicate of this. It's hard to say if that's a crazy idea, or if it's worth the trouble, but it is what I can do. Do you have a preference? Sep 18, 2017 at 0:51
• @gung: You can do that, or I can copy the information from that question into the answer here. Maybe that is the best? (I can edit that it seems from the edit history) Sep 18, 2017 at 7:15
• @kjetilbhalvorsen first of all, sorry for messing up since it was my idea to merge the threads as they seemed to be almost the same and both contained good answers. My initial impression was that merging the threads would do no harm. Maybe you could simply add "For example, when dealing with count data..." to your second paragraph? Your answer nicely answers the general "How to choose family?" question, so maybe it is worth leaving it in general thread?
– Tim
Sep 18, 2017 at 8:26
• @Tim I will edit as you say! Sep 18, 2017 at 10:02
• Let's try the edit. If you want me to repost the Q, ping me again. I'm going to dismiss the flag now. Sep 18, 2017 at 12:18