derive_allocation_rate | R Documentation |
This function validates and adjusts the treatment allocation rate (TAR
) to ensure it is correctly specified
for the given number of treatment arms (n_arms
). If TAR
is missing or NULL, it is assigned a default
vector of ones, ensuring equal allocation across all arms. The function also handles cases where TAR
is shorter than n_arms
, contains NA values, or has invalid values.
derive_allocation_rate(TAR = NULL, arm_names, verbose = FALSE)
TAR |
Optional numeric vector specifying the allocation rate for each treatment arm. If missing, a default equal allocation rate is assigned. |
arm_names |
Character vector specifying the names of the treatment arms. Used to name the elements of |
verbose |
Logical, if |
A named list representing the treatment allocation rate for each arm.
Thomas Debray tdebray@fromdatatowisdom.com
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.