anova.zeroinflation | R Documentation |
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.
## S3 method for class 'zeroinflation'
anova(
object,
...,
test = c("wald", "lr", "score", "gradient"),
verbose = TRUE,
submodel = c("counts", "zeros")
)
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, |
verbose |
an (optional) logical indicating if should the report of results be printed. As default, |
submodel |
an (optional) character string which allows to specify the model: "counts" or "zeros". By default,
|
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.
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.
####### 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.