| Dunnett.GLM | R Documentation |
When conducting statistical tests with multiple treatments, such as a control group and increasing concentrations of a test substance, ANOVA and parametric post-hoc tests (e.g. Dunnett's test) are commonly used. However, these tests require the assumptions of homogeneous variances and normally distributed data. For count data (e.g. counts of animals), these assumptions are typically violated, as the data are usually Poisson-distributed. The Dunnett.GLM function is based on a GLM followed by a Dunnett test to the model estimates. It was implemented to serve as an alternative approach to CPCAT while using a Quasi-Poisson regression (default), a negative binomial regression or a classical Poisson regression. The basic approach from Hothorn and Kluxen (2020) was adjusted to overcome methodological issues (see description of 'zero.treatment.action parameter'). For details on the structure of the input data, please refer to the dataset 'Daphnia.counts' provided alongside this package.
Dunnett.GLM(
groups,
counts,
control.name = NULL,
zero.treatment.action = "identity.link",
show.output = TRUE,
family = "quasipoisson",
overdispersion.test = NULL
)
groups |
Group vector |
counts |
Vector with count data |
control.name |
Character string with control group name (optional) |
zero.treatment.action |
Method for dealing with treatments only containing zeros (use either "identity.link" or "log(x+1)"). The method is only used if the data set contains dose/concentration groups that exclusively contain zero values (since the basic method provides for a logarithmic transformation of the data averages, it would lead to incorrect results). To deal with this methodological shortcoming, two options were implemented. The 'identity.link' option: the 'identity' link is used in the GLM instead of the 'log' link, i.e. the data are no longer transformed. The 'log(x+1)' option: The 'log' link is retained and 1 is added to each count value at the start of the procedure so that the subsequent log-transformation can be carried out without any problems. Note that both options may slightly distort the results. |
show.output |
Show/hide output |
family |
Distribution family used for the GLM (use either "quasipoisson", "nb" or "poisson").
The default "quasipoisson" fits a Quasi-Poisson regression, i.e. the variance is modelled as a
constant multiple (the dispersion parameter) of the mean. The option "nb" fits a negative binomial
regression via |
overdispersion.test |
Add the result of the overdispersion pre-test to the information object.
Use NULL or FALSE (default) to switch the pre-test off, TRUE to run it with the default settings of
|
Note that no dispersion diagnostic should be the sole basis for this decision. Any such test reduces the mean-variance relationship of a data set to a single number and, at the replication typical for ecotoxicological studies, has limited power, so that a non-significant result is weak evidence for the Poisson assumption rather than proof of it. The data should therefore always be inspected graphically as well, for example by plotting the group variances against the group means together with the identity line, or the residuals against the fitted values, and by looking at the per-group variance-to-mean ratios that Overdispersion.test reports.
The information object that is returned alongside the test results reports the distribution and the link function that were used, together with the dispersion parameter. For family = "quasipoisson" this is the estimated dispersion of the Quasi-Poisson model, for family = "nb" it is the estimated theta of the negative binomial model including its standard error, and for family = "poisson" it is noted that the dispersion is fixed at 1 by the model assumption.
Note on zero treatments and the negative binomial model: zero.treatment.action only takes effect if a treatment consists exclusively of zeros. In that situation family = "nb" cannot be combined with zero.treatment.action = "identity.link", and Dunnett.GLM stops with a message that says so. The reason is that an identity link forces the fitted mean of such a treatment to zero. A treatment with a mean of zero also has a variance of zero and therefore carries no information on the dispersion, so the negative binomial dispersion parameter is not identifiable at that point, and its maximum likelihood estimation divides by the fitted mean. Whether that mean is represented as a small positive number, as exactly zero or as a small negative number depends on floating point rounding and differs between platforms, which would make the result machine-dependent.
Use zero.treatment.action = "log(x+1)" together with family = "nb" instead. Adding one to every count removes the degenerate mean, the log link is retained and the dispersion is estimated without difficulty. If the identity link is required, use family = "quasipoisson" or family = "poisson", neither of which estimates a dispersion parameter that depends on the fitted mean in this way. Note that the two options also differ in interpretation: with a log link the Dunnett contrasts compare the treatments with the control on a multiplicative scale, with an identity link on an additive one.
R object with results and information from Dunnett.GLM calculations
Hothorn, L.; Kluxen, F. (2020): Statistical analysis of no observed effect concentrations or levels in eco-toxicological assays with overdispersed count endpoints. In: bioRxiv, 2020, https://doi.org/10.1101/2020.01.15.907881
Venables, W. N.; Ripley, B. D. (2002): Modern Applied Statistics with S. Fourth Edition. Springer, New York.
Daphnia.counts # example data provided alongside the package
# Test Dunnett.GLM with 'identity.link' option
Dunnett.GLM(groups = Daphnia.counts$Concentration,
counts = Daphnia.counts$Number_Young,
control.name = NULL,
zero.treatment.action = "identity.link",
show.output = TRUE)
# Test Dunnett.GLM with 'log(x+1)' option
Dunnett.GLM(groups = Daphnia.counts$Concentration,
counts = Daphnia.counts$Number_Young,
control.name = NULL,
zero.treatment.action = "log(x+1)",
show.output = TRUE)
# Test Dunnett.GLM using a negative binomial distribution instead of a Quasi-Poisson distribution.
# Note that the 'log(x+1)' option is used here: the example data contain a treatment consisting
# only of zeros, and the negative binomial model cannot be combined with the identity link in that
# situation (see the note on zero treatments below).
Dunnett.GLM(groups = Daphnia.counts$Concentration,
counts = Daphnia.counts$Number_Young,
control.name = NULL,
zero.treatment.action = "log(x+1)",
show.output = TRUE,
family = "nb")
# Test Dunnett.GLM using a classical Poisson distribution, the regression counterpart of CPCAT
Dunnett.GLM(groups = Daphnia.counts$Concentration,
counts = Daphnia.counts$Number_Young,
control.name = NULL,
zero.treatment.action = "log(x+1)",
show.output = TRUE,
family = "poisson")
# Test Dunnett.GLM and add the overdispersion pre-test to the information object
Dunnett.GLM(groups = Daphnia.counts$Concentration,
counts = Daphnia.counts$Number_Young,
control.name = NULL,
zero.treatment.action = "log(x+1)",
show.output = TRUE,
overdispersion.test = list(bootstrap.runs = 500, use.fixed.random.seed = 123))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.