Learn R Programming

gtsummary (version 0.1.0)

add_global.fmt_regression: Adds the global p-value for a categorical variables in fmt_regression objects

Description

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

Usage

# 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

Run this code
# NOT RUN {
lm(marker ~ stage + grade, trial) %>% fmt_regression() %>% add_global()
# }

Run the code above in your browser using DataLab