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
inline_text vignette
# 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 = NULL,
pvalue_fun = NULL,
...
)
A string reporting results from a gtsummary table
The following items (and more) 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'
{p.value}
p-value formatted with 'pvalue_fun'
{N}
number of observations in model
{label}
variable/variable level label
Other tbl_uvregression tools:
add_global_p()
,
add_q()
,
bold_italicize_labels_levels
,
modify
,
tbl_merge()
,
tbl_split()
,
tbl_stack()
,
tbl_strata()
,
tbl_uvregression()
# NOT RUN {
inline_text_ex1 <-
trial[c("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