gtsummary (version 1.3.6)

inline_text.tbl_regression: Report statistics from regression summary tables inline

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

# S3 method for 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,
  ...
)

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.

  • {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'

  • {ci} confidence interval formatted with x$estimate_fun

  • {p.value} p-value formatted with 'pvalue_fun'

  • {N} number of observations in model

  • {label} variable/variable level label

See Also

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

Examples

Run this code
# NOT RUN {
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")
# }

Run the code above in your browser using DataCamp Workspace