Learn R Programming

glmtoolbox (version 0.1.12)

anova.overglm: Comparison of nested models for alternatives to the Poisson and Binomial Regression Models under the presence of Overdispersion.

Description

Allows to compare nested models for regression models based on the negative binomial, beta-binomial, and random-clumped binomial distributions, which are alternatives to the Poisson and binomial regression models under the presence of overdispersion. The comparisons are performed by using the Wald, score, gradient or likelihood ratio tests.

Usage

# S3 method for overglm
anova(object, ..., test = c("wald", "lr", "score", "gradient"), verbose = TRUE)

Value

A matrix with the following three columns:

ChiThe value of the statistic of the test,
DfThe number of degrees of freedom,
Pr(>Chi)The p-value of the test-type test computed using the Chi-square distribution.

Arguments

object

an object of the class overglm.

...

another objects of the class overglm.

test

an (optional) character string which allows to specify the required test. The available options are: Wald ("wald"), Rao's score ("score"), likelihood ratio ("lr") and Terrell's gradient ("gradient") tests. As default, test is set to "wald".

verbose

an (optional) logical indicating if should the report of results be printed. As default, verbose is set to TRUE.

References

Buse A. (1982) The Likelihood Ratio, Wald, and Lagrange Multiplier Tests: An Expository Note. The American Statistician 36, 153-157.

Terrell G.R. (2002) The gradient statistic. Computing Science and Statistics 34, 206–215.

Examples

Run this code
## Example 1: Self diagnozed ear infections in swimmers
data(swimmers)
fit1 <- overglm(infections ~ frequency + location + age + gender, family="nb1(log)", data=swimmers)
anova(fit1, test="wald")
anova(fit1, test="score")
anova(fit1, test="lr")
anova(fit1, test="gradient")

## Example 2: Agents to stimulate cellular differentiation
data(cellular)
fit2 <- overglm(cbind(cells,200-cells) ~ tnf*ifn, family="bb(logit)", data=cellular)
anova(fit2, test="wald")
anova(fit2, test="score")
anova(fit2, test="lr")
anova(fit2, test="gradient")

Run the code above in your browser using DataLab