stat_propdiff_ci {tern} | R Documentation |
Proportion difference and confidence interval
Description
Function for calculating the proportion (or risk) difference and confidence interval between arm X (reference group) and arm Y. Risk difference is calculated by subtracting cumulative incidence in arm Y from cumulative incidence in arm X.
Usage
stat_propdiff_ci(
x,
y,
N_x,
N_y,
list_names = NULL,
conf_level = 0.95,
pct = TRUE
)
Arguments
x |
( |
y |
( |
N_x |
( |
N_y |
( |
list_names |
( |
conf_level |
( |
pct |
( |
Value
List of proportion differences and CIs corresponding to each pair of number of occurrences in x
and
y
. Each list element consists of 3 statistics: proportion difference, CI lower bound, and CI upper bound.
See Also
Split function add_riskdiff()
which, when used as split_fun
within rtables::split_cols_by()
with riskdiff
argument is set to TRUE
in subsequent analyze functions, adds a column containing
proportion (risk) difference to an rtables
layout.
Examples
stat_propdiff_ci(
x = list(0.375), y = list(0.01), N_x = 5, N_y = 5, list_names = "x", conf_level = 0.9
)
stat_propdiff_ci(
x = list(0.5, 0.75, 1), y = list(0.25, 0.05, 0.5), N_x = 10, N_y = 20, pct = FALSE
)