'Confidence interval when the category has zero observations- tbl_summary
I'm building a table with tbl_summary from the #gtsummary package. I have a categorical variable with one category with zero observations. I get the following error: There was an error for variable 'xx':
Error in mutate():
! Problem while computing ci = calculate_prop_ci(...).
i The error occurred in row 5.
Caused by error in stats::prop.test():
! elements of 'n' must be positive
Error:
! Dimension of 'typepart' and the added statistic do not match. Expecting statistic/data frame to be length/no. rows 3.
-Is there a way to code, so I get all the confidence intervals and a NA in the category with zero observations?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
