This function adds a column of the number of events to tables created with tbl_regression. 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).

The number of events is added to the internal .$table_body tibble, and not printed in the default output table (similar to N). The number of events is accessible via the inline_text function for printing in a report.

# S3 method for tbl_regression
add_nevent(x, quiet = NULL, ...)

Arguments

x

tbl_regression object

quiet

Logical indicating whether to print messages in console. Default is FALSE

...

Not used

Value

A tbl_regression object

Example Output

See also

Author

Daniel D. Sjoberg

Examples

add_nevent_ex <- glm(response ~ trt, trial, family = binomial) %>% tbl_regression() %>% add_nevent()