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)
A named list representing the treatment allocation rate for each arm.
Optional numeric vector specifying the allocation rate for each treatment arm. If missing, a default equal allocation rate is assigned.
Character vector specifying the names of the treatment arms. Used to name the elements of TAR
.
Logical, if TRUE
, displays messages about the status of TAR
derivation or assignment.
Thomas Debray tdebray@fromdatatowisdom.com