A {gtsummary} wrapper function that takes a gtsummary univariate regression table and adds appropriate cross tabs by exposure and outcome

add_crosstabs(x, wide = FALSE)

Arguments

x

Object with class tbl_uvregression from the gtsummary tbl_uvregression function or tbl_cmh from the epitabulate tbl_cmh function.

wide

TRUE/FALSE to specify whether would like to have the output in wide format. Results in four columns rather than two, but in a single row. This is only works for dichotomous variables (yes/no, TRUE/FALSE, male/female), others will be dropped with a warning message. (Default is FALSE)

References

Inspired by Daniel Sjoberg, see gtsummary github repo