Description Usage Arguments Value Author(s) See Also Examples
A function to randomize a new subject to a treatment given factor variables
1 | randomize(object, subject.id, factor.values)
|
object |
An object of class |
subject.id |
A string identifying the subject; no check is made on uniqueness |
factor.values |
A vector of factor values for the subject |
Returns an object of PocockSimonRandomizer
class
that contains the orginal object with updated slots
Balasubramanian Narasimhan
1 2 3 4 5 6 7 8 9 10 | expt <- ClinicalExperiment(number.of.factors = 3,
number.of.factor.levels = c(2, 2, 3),
number.of.treatments = 3)
r.obj <- new("PocockSimonRandomizer", expt, as.integer(12345))
r.obj <- randomize(r.obj, "Subject-001", c("1","2","2"))
## Try once again with same subject and you should get an error
## r.obj <- randomize(r.obj, "Subject-001", c("1","2","2"))
## Or try with a bad factor value and you should get an error
## r.obj <- randomize(r.obj, "Subject-002", c("1","2","5"))
lastRandomization(r.obj)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.