derive_allocation_rate {SimTOST} | R Documentation |
Derive and Validate Treatment Allocation Rate (TAR)
Description
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.
Usage
derive_allocation_rate(TAR = NULL, arm_names, verbose = FALSE)
Arguments
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 |
Value
A named list representing the treatment allocation rate for each arm.
Author(s)
Thomas Debray tdebray@fromdatatowisdom.com