add_global_p {gtsummary} | R Documentation |
Add the global p-values
Description
This function uses car::Anova()
(by default) to calculate global p-values
for model covariates.
Output from tbl_regression
and tbl_uvregression
objects supported.
Usage
add_global_p(x, ...)
## S3 method for class 'tbl_regression'
add_global_p(
x,
include = everything(),
keep = FALSE,
anova_fun = global_pvalue_fun,
type = "III",
quiet,
...
)
## S3 method for class 'tbl_uvregression'
add_global_p(
x,
include = everything(),
keep = FALSE,
anova_fun = global_pvalue_fun,
type = "III",
quiet,
...
)
Arguments
x |
( |
... |
Additional arguments to be passed to |
include |
( |
keep |
(scalar |
anova_fun |
( To pass a custom function, it must accept as its first argument is a model.
Note that anything passed in |
type |
Type argument passed to |
quiet |
Author(s)
Daniel D. Sjoberg
Examples
# Example 1 ----------------------------------
lm(marker ~ age + grade, trial) |>
tbl_regression() |>
add_global_p()
# Example 2 ----------------------------------
trial[c("response", "age", "trt", "grade")] |>
tbl_uvregression(
method = glm,
y = response,
method.args = list(family = binomial),
exponentiate = TRUE
) |>
add_global_p()