Description Usage Arguments Details Value References Examples
Allows to compare nested generalized linear models using Wald, score, gradient, and likelihood ratio tests.
1 2 3 4 5 6 
object 
an object of the class glm which is obtained from the fit of a generalized linear model. 
... 
another objects of the class glm which are obtained from the fit of generalized linear models. 
test 
an (optional) character string indicating the required type of test. The available options are: Wald ("wald"), Rao's score ("score"), Terrell's gradient ("gradient"), and likelihood ratio ("lrt") tests. By default, 
verbose 
an (optional) logical indicating if should the report of results be printed. By default, 
The Wald, Rao's score and Terrell's gradient tests are performed using the expected Fisher information matrix.
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 pvalue of the test computed using the Chisquare distribution.
Buse A. (1982) The Likelihood Ratio, Wald, and Lagrange Multiplier Tests: An Expository Note. The American Statistician 36, 153157.
Terrell G.R. (2002) The gradient statistic. Computing Science and Statistics 34, 206 – 215.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26  ## Example 1
Auto < ISLR::Auto
fit1 < glm(mpg ~ weight, family=inverse.gaussian("log"), data=Auto)
fit2 < update(fit1, . ~ . + horsepower)
fit3 < update(fit2, . ~ . + horsepower:weight)
anova2(fit1, fit2, fit3, test="lrt")
anova2(fit1, fit2, fit3, test="score")
anova2(fit1, fit2, fit3, test="wald")
anova2(fit1, fit2, fit3, test="gradient")
## Example 2
burn1000 < aplore3::burn1000
mod < death ~ age + tbsa + inh_inj
fit1 < glm(mod, family=binomial("logit"), data=burn1000)
fit2 < update(fit1, . ~ . + inh_inj + age*inh_inj + tbsa*inh_inj)
anova2(fit1, fit2, test="lrt")
anova2(fit1, fit2, test="score")
anova2(fit1, fit2, test="wald")
anova2(fit1, fit2, test="gradient")
## Example 3
fit < glm(lesions ~ 1 + time, family=poisson("log"), data=aucuba)
anova2(fit, test="lrt")
anova2(fit, test="score")
anova2(fit, test="wald")
anova2(fit, test="gradient")

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.