View source: R/combine_terms.R
combine_terms | R Documentation |
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, ...)
x |
( |
formula_update |
( |
label |
( |
quiet |
|
... |
Additional arguments passed to stats::anova |
tbl_regression
object
Daniel D. Sjoberg
# Example 1 ----------------------------------
# Logistic Regression Example, LRT p-value
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"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.