Report statistics from regression summary tables inline
Takes an object with class tbl_regression, and the
location of the statistic to report and returns statistics for reporting
inline in an R markdown document. Detailed examples in the
inline_text vignette
## S3 method for class 'tbl_regression'
inline_text(
x,
variable,
level = NULL,
pattern = "{estimate} ({conf.level*100}% CI {conf.low}, {conf.high}; {p.value})",
estimate_fun = NULL,
pvalue_fun = NULL,
...
)x |
Object created from tbl_regression |
variable |
Variable name of statistics to present |
level |
Level of the variable to display for categorical variables.
Default is |
pattern |
String indicating the statistics to return.
Uses glue::glue formatting.
Default is |
estimate_fun |
function to style model coefficient estimates.
Columns 'estimate', 'conf.low', and 'conf.high' are formatted.
Default is |
pvalue_fun |
function to style p-values and/or q-values.
Default is |
... |
Not used |
A string reporting results from a gtsummary table
The following items (and more) are available to print. Use print(x$table_body) to
print the table the estimates are extracted from.
{estimate} coefficient estimate formatted with 'estimate_fun'
{conf.low} lower limit of confidence interval formatted with 'estimate_fun'
{conf.high} upper limit of confidence interval formatted with 'estimate_fun'
{p.value} p-value formatted with 'pvalue_fun'
{N} number of observations in model
{label} variable/variable level label
Daniel D. Sjoberg
Other tbl_regression tools:
add_global_p(),
add_q(),
bold_italicize_labels_levels,
combine_terms(),
modify,
tbl_merge(),
tbl_regression(),
tbl_stack()
inline_text_ex1 <- glm(response ~ age + grade, trial, family = binomial(link = "logit")) %>% tbl_regression(exponentiate = TRUE) inline_text(inline_text_ex1, variable = age) inline_text(inline_text_ex1, variable = grade, level = "III")
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.