Skip to contents

At the interim analysis, compare treatment and each experimental to control using a chi-squared test. Any treatment with p-value < dMaxPValue is selected for stage 2. If none of the treatments have a p-value < dMaxPValue, select the treatment with the smallest p-value In the second stage, the randomization ratio will be 1:1 (experimental:control)

Usage

SelectExpWithPValueLessThanSpecified(
  SimData,
  DesignParam,
  LookInfo,
  UserParam = NULL
)

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.

Examples