inline_text.tbl_uvregression: Report statistics from regression summary tables inline

Description Usage Arguments pattern argument See Also Examples

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

1
2
3
4
5
## S3 method for class '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), ...)

Arguments

x

object created from tbl_regression

variable

variable name of statistic 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

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). Uses glue::glue formatting. 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

pattern argument

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

See Also

Other tbl_uvregression tools: add_global.tbl_uvregression, add_nevent.tbl_uvregression, add_q.tbl_uvregression, bold_italicize_labels_levels, tbl_merge, tbl_uvregression

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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")

ddsjoberg/gtsummary documentation built on May 14, 2019, 11:03 p.m.