afun_riskdiff {tern} | R Documentation |
Analysis function to calculate risk difference column values
Description
In the risk difference column, this function uses the statistics function associated with afun
to
calculates risk difference values from arm X (reference group) and arm Y. These arms are specified
when configuring the risk difference column which is done using the add_riskdiff()
split function in
the previous call to rtables::split_cols_by()
. For all other columns, applies afun
as usual. This
function utilizes the stat_propdiff_ci()
function to perform risk difference calculations.
Usage
afun_riskdiff(
df,
labelstr = "",
afun,
...,
.stats = NULL,
.stat_names = NULL,
.formats = NULL,
.labels = NULL,
.indent_mods = NULL
)
Arguments
df |
( |
labelstr |
( |
afun |
(named |
... |
additional arguments for the lower level functions. |
.stats |
( |
.stat_names |
( |
.formats |
(named |
.labels |
(named |
.indent_mods |
(named |
Value
A list of formatted rtables::CellValue()
.
See Also
-
stat_propdiff_ci()
for details on risk difference calculation. Split function
add_riskdiff()
which, when used assplit_fun
withinrtables::split_cols_by()
withriskdiff
argument set toTRUE
in subsequent analyze functions calls, adds a risk difference column to a table layout.