4

I am going to use the glm to estimate nutrient concentration as a function of river flow. My nutrient concentration are not normally distributed and variance is not constant. So, I would like try GLM but not sure what family I should use. Data are continuous, positive and greater than zero. I would appreciate if anyone could correct my code and let me know if I am missing anything:

model2=glm(TDPConcSam~SamDayFlow,Sample.lm, family=)
Farshad
  • 43
  • 6

1 Answers1

3

The form of the predictor is irrelevant to the choice of family which describes the conditional distribution of the response.

There are a number of families on might use for a continuous positive random variable.

I'd probably start with considering a Gamma family (variance proportional to mean squared), possibly with a log-link (your own subject matter knowledge should form a better basis on which to choose a link though).

There's also Inverse Gaussian (variance proportional to mean cubed) in most implementations of GLMs, and in some packages you can use the Tweedie family (power variance function -- which includes those earlier two as special cases).

Another alternative that's sometimes used with concentrations is the lognormal; with positive data one might take logs and then fit a (possibly linear) least squares regression model (since the assumed conditional distribution would be normal after taking logs).

Glen_b
  • 257,508
  • 32
  • 553
  • 939
  • 2
    FWIW, such data are only strictly positive because we don't have machines/methods sensitive enough to detect low values of the nutrient in question. Technically, I suppose, a zero is possible, but in any case we're not going to be able to distinguish among values in the range 0, $c$ where $c$ is the detection limit of the method in question. That said, I've had good experiences using a Gamma family for GLMs with such data, – Gavin Simpson Feb 09 '15 at 04:27
  • 1
    Of course, if lower detection limits became an issue, one could incorporate censoring into the model. – Glen_b Feb 09 '15 at 09:14