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

# S3 method for tbl_uvregression
add_global_p(
  x,
  type = NULL,
  include = everything(),
  keep = FALSE,
  quiet = NULL,
  ...
)

Arguments

x

Object with class tbl_uvregression from the tbl_uvregression function

type

Type argument passed to car::Anova. Default is "III"

include

Variables to calculate global p-value for. Input may be a vector of quoted or unquoted variable names. tidyselect and gtsummary select helper functions are also accepted. Default is everything().

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

quiet

Logical indicating whether to print messages in console. Default is FALSE

...

Additional arguments to be passed to car::Anova.

Value

A tbl_uvregression object

Example Output

See also

Author

Daniel D. Sjoberg

Examples

tbl_uv_global_ex2 <- trial[c("response", "trt", "age", "grade")] %>% tbl_uvregression( method = glm, y = response, method.args = list(family = binomial), exponentiate = TRUE ) %>% add_global_p()
#> Global p-values for variable(s) `include = c("trt", "age", "grade")` were #> calculated with #> `car::Anova(mod = x$model_obj, type = "III")`