display_coxph2 | R Documentation |
Given a string with an "outcome" and a vector string with "predictors", displays univariable and (optionally) multivariable results from Cox proportional hazards regression in a format suitable for presentation.
This version allows you to explicitly provide the outcome and predictors in case there are issues with getting a full model fit.
display_coxph2(
data,
outcome,
predictors,
add_multi = FALSE,
format = "html",
conf_level = 0.95,
exponentiate = TRUE,
include_last_row = TRUE
)
data |
A tibble or data frame with the full dataset. |
outcome |
Character string. The dependent variable (outcome) for Cox regression, formatted as "Surv(time, event)". |
predictors |
Character vector. Independent variables (predictors/covariates) for univariable and/or multivariable modeling. |
add_multi |
Logical; include multivariable results. Default is |
format |
Display format in case characters need escaping. Placeholder for future use. Default is "html". |
conf_level |
The confidence level to use for confidence intervals. Must be between 0 and 1. Default is 0.95. |
exponentiate |
Logical; whether to exponentiate coefficient estimates to show hazard ratios. Default is |
include_last_row |
Adds a row at the end of each set of results for spacing. Default is |
A tibble containing Cox regression results.
## Not run:
library(survival)
data(lung)
display_coxph2(data = lung,
outcome = "Surv(time, status)",
predictors = c("age", "sex", "ph.ecog"))
display_coxph2(data = lung,
outcome = "Surv(time, status)",
predictors = c("age", "sex", "ph.ecog"),
add_multi = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.