Combine terms in a regression model
The function combines terms from a regression model, and replaces the terms
with a single row in the output table. The p-value is calculated using
stats::anova()
.
combine_terms(x, formula_update, label = NULL, quiet = NULL, ...)
x |
a |
formula_update |
formula update passed to the stats::update.
This updated formula is used to construct a reduced model, and is
subsequently passed to |
label |
Option string argument labeling the combined rows |
quiet |
Logical indicating whether to print messages in console. Default is
|
... |
Additional arguments passed to stats::anova |
tbl_regression
object
Example 1
Daniel D. Sjoberg
Other tbl_regression tools:
add_global_p()
,
add_q()
,
bold_italicize_labels_levels
,
inline_text.tbl_regression()
,
modify
,
tbl_merge()
,
tbl_regression()
,
tbl_stack()
# Example 1 ---------------------------------- # Logistic Regression Example, LRT p-value combine_terms_ex1 <- glm( response ~ marker + I(marker^2) + grade, trial[c("response", "marker", "grade")] %>% na.omit(), # keep complete cases only! family = binomial ) %>% tbl_regression(label = grade ~ "Grade", exponentiate = TRUE) %>% # collapse non-linear terms to a single row in output using anova combine_terms( formula_update = . ~ . - marker - I(marker^2), label = "Marker (non-linear terms)", test = "LRT" )
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.