Learn R Programming

gtsummary (version 1.2.0)

inline_text.tbl_uvregression: Report statistics from regression summary tables inline

Description

Extracts and returns statistics from a table created by the tbl_uvregression function for inline reporting in an R markdown document. Detailed examples in the tbl_regression vignette

Usage

# S3 method for tbl_uvregression
inline_text(x, variable, level = NULL,
  pattern = "{estimate} ({conf.level*100}% CI {conf.low}, {conf.high}; {p.value})",
  estimate_fun = x$inputs$estimate_fun, pvalue_fun = function(x)
  style_pvalue(x, prepend_p = TRUE), ...)

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_uvregression tools: add_global_p.tbl_uvregression, add_nevent.tbl_uvregression, add_q.tbl_uvregression, bold_italicize_labels_levels, bold_p.tbl_stack, bold_p.tbl_uvregression, modify_header, sort_p.tbl_uvregression, tbl_merge, tbl_stack, tbl_uvregression

Examples

Run this code
# NOT RUN {
inline_text_ex1 <-
  trial %>%
  dplyr::select(response, age, grade) %>%
  tbl_uvregression(
    method = glm,
    method.args = list(family = binomial),
    y = response,
    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 DataLab