View source: R/diff_ard_hierarchical.R
| diff_ard_hierarchical | R Documentation |
Calculate the difference in event rates between two groups of a stacked
hierarchical ARD created with ard_stack_hierarchical(). For every node in
the hierarchy (e.g. each system organ class and each preferred term), the
rate (p statistic) of a second group is subtracted from the rate of a first
group and returned under a new statistic named "estimate".
The input ARD must contain the p statistic and at least one by variable.
The by (grouping) dimension is collapsed in the result—only the estimate
rows are returned.
diff_ard_hierarchical(x, levels = NULL)
x |
( |
levels |
(
Defaults to |
Rates are stored on the [0, 1] scale (as p is), so the returned estimate
values lie in [-1, 1]. A hierarchy node observed in only one of the two
groups is treated as a rate of 0 in the group where it is absent.
an ARD data frame of class 'card'
sort_ard_hierarchical(), filter_ard_hierarchical()
ard <- ard_stack_hierarchical(
ADAE,
variables = c(AESOC, AEDECOD),
by = TRTA,
denominator = ADSL,
id = USUBJID
)
# difference between two of the three treatment arms
diff_ard_hierarchical(ard, levels = list(TRTA = "Xanomeline High Dose", TRTA = "Placebo"))
# equivalent, using the two-cell form
diff_ard_hierarchical(
ard,
levels = list(list(TRTA = "Xanomeline High Dose"), list(TRTA = "Placebo"))
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.