Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

anova.overglm

Comparison of nested Negative Binomial and Beta-Binomial Regression Models


Description

Allows to compare nested negative binomial and beta-binomial regression models using Wald, score, gradient and likelihood ratio tests.

Usage

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

Arguments

object

an object of the class overglm which is obtained from the fit of a negative binomial or beta-binomial model.

...

another objects of the class overglm which are obtained from the fit of negative binomial or beta-binomial models.

test

an (optional) character string indicating the required test. The available options are: Wald ("wald"), Rao's score ("score"), likelihood ratio ("lrt") and Terrell's gradient ("gradient") tests. By default, test is set to be "wald".

verbose

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

Details

The Wald, Rao's score and Terrell's gradient tests are performed using the observed Fisher information matrix.

Value

A matrix with three columns which contains the following:

  • Chi: The value of the statistic of the test.

  • Df: The number of degrees of freedom.

  • Pr(>Chi): The p-value of the test computed using the Chi-square distribution.

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

## Example 1
fit1 <- overglm(cbind(cells,200-cells) ~ tnf, family="bb(logit)", data=cellular)
fit2 <- update(fit1, . ~ . + ifn)
fit3 <- update(fit2, . ~ . + tnf:ifn)
anova(fit1, fit2, fit3, test="wald")
anova(fit1, fit2, fit3, test="score")
anova(fit1, fit2, fit3, test="lrt")
anova(fit1, fit2, fit3, test="gradient")

## Example 2
fit1 <- overglm(infections ~ frequency, family="nb1(log)", data=swimmers)
fit2 <- update(fit1, . ~ . + location)
fit3 <- update(fit2, . ~ . + age)
fit4 <- update(fit3, . ~ . + gender)
anova(fit1, fit2, fit3, fit4, test="wald")
anova(fit1, fit2, fit3, fit4, test="score")
anova(fit1, fit2, fit3, fit4, test="lrt")
anova(fit1, fit2, fit3, fit4, test="gradient")

glmtoolbox

Set of Tools to Data Analysis using Generalized Linear Models

v0.1.0
GPL-2 | GPL-3
Authors
Luis Hernando Vanegas [aut, cre], Luz Marina Rondón [aut], Gilberto A. Paula [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.