gtsummary (version 1.3.6)

add_nevent.tbl_uvregression: Add number of events to a regression table

Description

Adds a column of the number of events to tables created with tbl_uvregression. Supported model types include GLMs with binomial distribution family (e.g. stats::glm, lme4::glmer, and geepack::geeglm) and Cox Proportion Hazards regression models (survival::coxph).

Usage

# S3 method for tbl_uvregression
add_nevent(x, ...)

Arguments

x

tbl_uvregerssion object

...

Not used

Value

A tbl_uvregression object

Reporting Event N

The number of events is added to the internal .$table_body tibble, and printed to the right of the N column. The number of events is also accessible via the inline_text function for printing in a report.

Example Output

See Also

Other tbl_uvregression tools: add_global_p(), add_q(), bold_italicize_labels_levels, inline_text.tbl_uvregression(), modify, tbl_merge(), tbl_stack(), tbl_uvregression()

Examples

Run this code
# NOT RUN {
tbl_uv_nevent_ex <-
  trial[c("response", "trt", "age", "grade")] %>%
  tbl_uvregression(
    method = glm,
    y = response,
    method.args = list(family = binomial)
  ) %>%
  add_nevent()
# }

Run the code above in your browser using DataLab