anova.zeroinflation: Comparison of nested models for Regression Models to deal...

View source: R/overglm3.R

anova.zeroinflationR Documentation

Comparison of nested models for Regression Models to deal with Zero-Excess in Count Data

Description

Allows to compare nested models for regression models used to deal with zero-excess in count data. The comparisons are performed by using the Wald, score, gradient or likelihood ratio tests.

Usage

## S3 method for class 'zeroinflation'
anova(
  object,
  ...,
  test = c("wald", "lr", "score", "gradient"),
  verbose = TRUE,
  submodel = c("counts", "zeros")
)

Arguments

object

an object of the class zeroinflation.

...

another objects of the class zeroinflation.

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.

submodel

an (optional) character string which allows to specify the model: "counts" or "zeros". By default, submodel is set to "counts".

Value

A matrix with the following three columns:

Chi

The value of the statistic of the test,

Df

The number of degrees of freedom,

Pr(>Chi)

The p-value of the test 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: Article production by graduate students in biochemistry PhD programs
bioChemists <- pscl::bioChemists
fit1 <- zeroinf(art ~ fem + kid5 + ment | ment, family="nb1(log)", data = bioChemists)
anova(fit1,test="wald")
anova(fit1,test="lr")
anova(fit1,test="score")
anova(fit1,test="gradient")

fit2 <- zeroalt(art ~ fem + kid5 + ment, family="nb1(log)", data = bioChemists)
anova(fit2,submodel="zeros",test="wald")
anova(fit2,submodel="zeros",test="lr")
anova(fit2,submodel="zeros",test="score")
anova(fit2,submodel="zeros",test="gradient")


glmtoolbox documentation built on Sept. 11, 2024, 7:32 p.m.