anova.glimML.RdPerforms likelihood-ratio tests on nested models. Currently, one method was implemented
for beta-binomial models (betabin) or negative-binomial models (negbin).
# S4 method for class 'glimML'
anova(object, ...)The anova method for models of formal class “glimML” needs at least 2 nested models of the
same type (either beta-binomial or negative-binomial models: they cannot be mixed). The quantity of interest is
the deviance difference between the compared models: it is a log-likelihood ratio statistic. Under the null
hypothesis that 2 nested models fit the data equally well, the deviance difference has an approximate
\(\chi^2\) distribution with degrees of freedom = the difference in the number of parameters between
the compared models (Mc Cullagh and Nelder, 1989).
An object of formal class “anova.glimML” with 3 slots:
A vector of character strings with each component giving the name of the models and the formulas for the fixed and random effects.
A data frame containing the results. Row names correspond to the models.
| logL | numeric | maximized log-likelihood |
| k | numeric | number of parameters in the model |
| AIC | numeric | Akaike information criterion for the model |
| AICc | numeric | Corrected Akaike information criterion for the model |
| BIC | numeric | Bayesian information criterion the model |
| Resid. dev. | numeric | Residual deviance |
| Resid. Df | numeric | df of the residuals |
| Test | character | Nested models which are tested |
| Deviance | numeric | Deviance difference between the 2 models |
| Df | numeric | df associated with deviance difference |
| P(> Chi2) | numeric | P value associated with H0. |
A character chain indicating the kind of fitted model: “BB” for beta-binomial, or “NB” for negative-binomial model.
The comparison between 2 or more models will only be valid if they are fitted to the same data set.
McCullagh, P., Nelder, J.A., 1989. Generalized linear models. London, Chapman & Hall, 511 p.
See Appendix C. Likelihood ratio statistics, p. 476-478.
data(orob2)
# likelihood ratio test for the effect of root
fm1 <- betabin(cbind(y, n - y) ~ seed, ~ 1, data = orob2)
fm2 <- betabin(cbind(y, n - y) ~ seed + root, ~ 1, data = orob2)
anova(fm1, fm2)
#> Analysis of Deviance Table (beta-binomial models)
#>
#> fm1: fixed = cbind(y, n - y) ~ seed; random = ~1
#> fm2: fixed = cbind(y, n - y) ~ seed + root; random = ~1
#>
#> logL k AIC AICc BIC Resid. dev. Resid. Df Test Deviance Df
#> fm1 -63.55 3 133.1 134.5 136.2 50.51 18
#> fm2 -55.83 4 119.7 122.2 123.8 35.07 17 fm1-fm2 15.44 1
#> P(> Chi2)
#> fm1
#> fm2 8.509e-05