This function uses Anova from the car package with type = "III" to calculate global p-values.

# S3 method for fmt_regression
add_global(x, terms = NULL, keep = FALSE, ...)

Arguments

x

object with class fmt_regression from the fmt_regression function

terms

Character vector of terms for which to add global p-values. Default is NULL which will add global p-values for all categorical variables

keep

logical argument whether to keep the individual p-values for the levels of the categorical variable. Default is FALSE

...

arguments to be passed to Anova. Adding test.statistic = can change the type of test (e.g. Likelihood-ratio, Wald, etc.).

Examples

lm(marker ~ stage + grade, trial) %>% fmt_regression() %>% add_global()
#> #> N = 192 Coefficient 95% CI p-value #> T Stage >0.9 #> T1 Ref. #> T2 0.06 -0.29, 0.41 #> T3 0.11 -0.25, 0.48 #> T4 0.09 -0.25, 0.43 #> Grade 0.6 #> I Ref. #> II 0.17 -0.15, 0.48 #> III 0.08 -0.22, 0.37