inline_text.tbl_regression: Report statistics from regression summary tables inline

Description Usage Arguments Value pattern argument Author(s) See Also Examples

View source: R/inline_text.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 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,
  ...
)

Arguments

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 NULL, returning the top row in the table for the variable.

pattern

String indicating the statistics to return. Uses glue::glue formatting. Default is "{estimate} ({conf.level }% CI {conf.low}, {conf.high}; {p.value})". All columns from x$table_body are available to print as well as the confidence level (conf.level). See below for details.

estimate_fun

function to style model coefficient estimates. Columns 'estimate', 'conf.low', and 'conf.high' are formatted. Default is x$inputs$estimate_fun

pvalue_fun

function to style p-values and/or q-values. Default is function(x) style_pvalue(x, prepend_p = TRUE)

...

Not used

Value

A string reporting results from a gtsummary table

pattern argument

The following items are available to print. Use print(x$table_body) to print the table the estimates are extracted from.

Author(s)

Daniel D. Sjoberg

See Also

Other tbl_regression tools: add_global_p(), add_q(), bold_italicize_labels_levels, combine_terms(), modify, tbl_merge(), tbl_regression(), tbl_stack()

Examples

1
2
3
4
5
6
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")

ddsjoberg/gtsummary documentation built on April 8, 2021, 5:48 a.m.