0

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 in tbl_summary():
unused arguments (conf.level = 0.95, conf.method = "wilson")

Backtrace:

  1. gtsummary::tbl_strata(...)
    11. gtsummary:::map(.data$data, .tbl_fun, ...)
    12. base::lapply(.x, .f, ...)
    13. global FUN(X[[i]], ...)
2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.