Learn R Programming

gtsummary (version 0.1.0)

inline_text.fmt_regression: Report statistics from fmt_regression and fmt_uni_regression inline in an Rmarkdown document

Description

Report statistics from fmt_regression and fmt_uni_regression inline in an Rmarkdown document

Usage

# S3 method for fmt_regression
inline_text(x, cell,
  stat = "{est} (95% CI {ci}; {p_pvalue})", sep = ":", ...)

# S3 method for fmt_uni_regression inline_text(x, cell, stat = "{est} (95% CI {ci}; {p_pvalue})", sep = ":", ...)

Arguments

x

object of class fmt_regression or fmt_uni_regression object

cell

identifier for which cell to return from the fmt_regression object

stat

Statistic to report. User can access the primary estimate (est), the lower and upper limit of the confidence interval (ll and ul), confidence interval (ci), N (N), pvalue (pvalue), and pvalue with p= or p< appended (p_pvalue). Default is "{est} (95% CI {ci}; {p_pvalue})"

sep

a character string to separate the terms

...

further arguments passed from generic inline_text()

Value

Formatted descriptive statistics from a fmt_regression object

Examples

Run this code
# NOT RUN {
mod <- glm(response ~ age + grade + stage, trial, family = binomial(link = "logit")) %>%
  fmt_regression(exponentiate = TRUE)
inline_text(mod, "age")

inline_text(mod, "grade:III")

trial %>%
  fmt_uni_regression(
    method = "lm",
    y = "age"
  ) %>%
  inline_text("grade:II")
# }

Run the code above in your browser using DataLab