Can I use the gt_summary tbl_strata to calculate prevalences and their wilson 95% CIs?
tbl1 <- tbl_strata(
data = interestbd_df,
strata = still_births,
.tbl_fun = ~tbl_summary(
.,
type = all_categorical()~ "categorical",
statistic = all_categorical()~ "{p} ({n}/{N})",
percent = "cell",
missing = "no",
by= NULL,
conf.level=0.95,
conf.method= "wilson"
),
.combine_with = "tbl_stack"
)
I hoped to get prevalence and CIs but got this error:
Error in
dplyr::mutate():
In argument:tbl = switch(...).
Caused by error intbl_summary():
unused arguments (conf.level = 0.95, conf.method = "wilson")Backtrace:
- gtsummary::tbl_strata(...)
11. gtsummary:::map(.data$data, .tbl_fun, ...)
12. base::lapply(.x, .f, ...)
13. global FUN(X[[i]], ...)