get_par {SimTOST} | R Documentation |
Parameter Configuration for Endpoints and Comparators
Description
Constructs and returns a list of key parameters (mean vectors, variance-covariance matrices, and allocation rates) required for input into the sampleSize
function. This function ensures that the parameters for each endpoint and comparator are consistent, properly named, and formatted.
Usage
get_par(
mu_list,
varcov_list,
TAR_list,
type_y = NA,
arm_names = NA,
y_names = NA
)
Arguments
mu_list |
A list of mean ( |
varcov_list |
A list of variance-covariance matrices. Each element corresponds to a comparator, with a matrix of size |
TAR_list |
A list of treatment allocation rates (TARs) for each comparator. Each element contains a numeric value (can be fractional or integer) representing the allocation rate for the respective comparator. |
type_y |
A numeric vector specifying the type of each endpoint. Use |
arm_names |
(Optional) A character vector containing names of the arms. If not provided, default names (e.g., T1, T2, ...) will be generated. |
y_names |
(Optional) A character vector containing names of the endpoints. If not provided, default names (e.g., y1, y2, ...) will be generated. |
Value
A named list with the following components:
mu
A list of mean vectors, named according to
arm_names
.varcov
A list of variance-covariance matrices, named according to
arm_names
.tar
A list of treatment allocation rates (TARs), named according to
arm_names
.type_y
A vector specifying the type of each endpoint.
weight_seq
A weight sequence calculated from
type_y
, used for endpoint weighting.y_names
A vector of names for the endpoints, named as per
y_names
.
#' @details
This function ensures that all input parameters (mu_list
, varcov_list
, and TAR_list
) are consistent across comparators and endpoints. It performs checks for positive semi-definiteness of variance-covariance matrices and automatically assigns default names for arms and endpoints if not provided.
Examples
mu_list <- list(c(0.1, 0.2), c(0.15, 0.25))
varcov_list <- list(matrix(c(1, 0.5, 0.5, 1), ncol = 2), matrix(c(1, 0.3, 0.3, 1), ncol = 2))
TAR_list <- list(0.5, 0.5)
get_par(mu_list, varcov_list, TAR_list, type_y = c(1, 2), arm_names = c("Arm1", "Arm2"))