Learn R Programming

gtsummary (version 1.2.1)

add_global_p.tbl_regression: Adds the global p-value for categorical variables

Description

This function uses car::Anova with argument type = "III" to calculate global p-values for categorical variables.

Usage

# S3 method for tbl_regression
add_global_p(x, terms = NULL, keep = FALSE,
  ...)

Arguments

x

Object with class tbl_regression from the tbl_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 indicating whether to also retain the individual p-values in the table output for each level of the categorical variable. Default is FALSE

...

Additional arguments to be passed to car::Anova

Value

A tbl_regression object

Example Output

See Also

Other tbl_regression tools: add_nevent.tbl_regression, bold_italicize_labels_levels, bold_p.tbl_regression, bold_p.tbl_stack, inline_text.tbl_regression, modify_header, sort_p.tbl_regression, tbl_merge, tbl_regression, tbl_stack

Examples

Run this code
# NOT RUN {
tbl_lm_global_ex1 <-
  lm(marker ~ age + grade, trial) %>%
  tbl_regression() %>%
  add_global_p()
# }

Run the code above in your browser using DataLab