createTrial {randPack} | R Documentation |
This function should be used in preference to calls to new
to create
instances of the ClinicalTrials class.
createTrial(CExp, seed)
CExp |
An instance of the ClinicalExperiment class. |
seed |
A seed for the random number generator. |
To ensure proper initialization of the different components this
function should be called when creating new instances of the
ClinicalTrial
class.
An instance of the ClinicalTrial
class.
R. Gentleman
#define the available treatments and their relative allocations trts = c( A = 3L, B = 4L, C = 1L) #describe the permuted block design pbdesc = new("PermutedBlockDesc", treatments = trts, type="PermutedBlock", numBlocks=4L) pIDs = new("PatientID", strata="Test", start=100L, stop=200L) #define the ClinicalExperiment CE1 = new("ClinicalExperiment", name="My first experiment", treatments = trts, factors = list( F1 = c("A", "B", "C"), F2 = c("t1", "t2")), randomization = list(pbdesc), patientIDs = pIDs ) #now create the instance of the trial CT1 = createTrial(CE1, seed=301)