Skip to contents

The default anova_fun of add_global_p(). For every term of the model formula it tests that all the term's coefficients are zero, with the statistic car::Anova() uses for the model class: an F test for lm, a likelihood-ratio test for glm and coxph. Other model classes use a Wald chi-square test from vcov().

Usage

global_pvalue_fun(x, type = "III", ...)

Arguments

x

(regression model)
A fitted model.

type

(string)
"III" (the default) tests each term with every other term kept in the model; "II" tests each term that can be dropped while respecting marginality, with stats::drop1().

...

Not used.

Value

A data frame with the columns term, df, statistic and p.value, one row per term.

Examples

global_pvalue_fun(glm(response ~ age + grade, trial, family = binomial))
#>    term df  statistic   p.value
#> 1   age  1 0.02458829 0.8753973
#> 2 grade  2 3.72205767 0.1555126