derive_allocation_rate: Derive and Validate Treatment Allocation Rate (TAR)

View source: R/SampleSize.R

derive_allocation_rateR 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 TAR.

verbose

Logical, if TRUE, displays messages about the status of TAR derivation or assignment.

Value

A named list representing the treatment allocation rate for each arm.

Author(s)

Thomas Debray tdebray@fromdatatowisdom.com


SimTOST documentation built on April 3, 2025, 9:05 p.m.