Select user-specified number of treatments to advance that have the largest number of responses.
SelectSpecifiedNumberOfExpWithHighestResponses.Rd
This function is used for the MAMS design with a binary outcome and will perform treatment selection at the interim analysis (IA). At the IA, the user-specified number of experimental treatments (QtyOfArmsToSelect) that have the largest number of responses are selected. After the IA, we would like to randomize based on user specified inputs: 1:Rank1AllocationRatio:Rank2AllocationRatio (control, selected experimental arm with highest number of responses, selected experimental arm with the second highest number of responses)
Usage
SelectSpecifiedNumberOfExpWithHighestResponses(
SimData,
DesignParam,
LookInfo,
UserParam = NULL
)
Arguments
- SimData
Data frame which consists of data generated in current simulation
- DesignParam
List of Design and Simulation Parameters required to perform treatment selection.
- LookInfo
List containing Design and Simulation Parameters, which might be required to perform treatment selection
- UserParam
A list of user defined parameters in East. The default must be NULL. If UserParam is supplied, the list must contain the following named elements:
- UserParam$QtyOfArmsToSelect
A value that defines how many treatment arms are chosen to advance. Note this number must match the number of user-specified allocation values. If this value is not specified, the default is 2.
- UserParam$Rank1AllocationRatio
A value that specifies the allocation to the arm with the highest response If this value is not specified, the default is 2.
- UserParam$Rank2AllocationRatio
A value that specifies the allocation to the arm with the next highest response If this value is not specified, the default is 1.
Value
TreatmentID A vector that consists of the experimental treatments that were selected and carried forward. Experimental treatment IDs are 1, 2, ..., number of experimental treatments
AllocRatio A vector that consists of the allocation for all experimental treatments that continue to the next phase.
ErrorCode An integer value: ErrorCode = 0 --> No Error ErrorCode > 0 --> Non fatal error, current simulation is aborted but the next simulations will run ErrorCode < 0 --> Fatal error, no further simulation will be attempted
Note
The length of TreatmentID and AllocRatio must be the same.
The allocation ratio for control will be 1, AllocRatio are relative to this value. So, a 2 will randomize twice as many to experimental
The order of AllocRatio should be the same as TreatmentID, and the corresponding elements will have the assigned allocation ratio
The returned vector ONLY includes TreatmentIDs for experimental treatments, eg TreatmentID = c( 0, 1, 2 ) is invalid, because you do NOT need to include 0 for control.
You must return at LEAST one treatment and one allocation ratio
Helpful Hints: There is often info that East sends to R that are not shown in a given example. It can be very helpful to save the input objects and then load them into your R session and inspect them. This can be done with the following R code in your function.
saveRDS( SimData, "SimData.Rds") saveRDS( DesignParam, "DesignParam.Rds" ) saveRDS( LookInfo, "LookInfo.Rds" )
The above code will save each of the input objects to a file so they may be examined within R.