Description Usage Arguments Value Slots Examples
A randomizer implementing the minimization method of Pocock
and Simon (1975). The definition here closely follows the description in
the paper. Objects can be created by calls of the form
new("PocockSimonRandomizer", expt, seed, tr.ratios, d.func, g.func, p.func)
.
Arguments include a ClinicalExperiment object,
a random number seed, the ratio of treatment counts, a function
to use for computing imbalance for each treatment, a function to
compute the overall imbalance, and a function that provides the
probability allocation to address the imbalance.
Compute imbalances for each treatment assignment given a set of factor values
Compute the overall imbalance given individual imbalances
Randomize a subject given a subject id and the set of factor values
Return the last randomization performed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | ## S4 method for signature 'PocockSimonRandomizer'
show(object)
tr.assignments(x) <- value
## S4 replacement method for signature 'PocockSimonRandomizer'
tr.assignments(x) <- value
tr.assignments(x)
## S4 method for signature 'PocockSimonRandomizer'
tr.assignments(x)
stateTable(x)
## S4 method for signature 'PocockSimonRandomizer'
stateTable(x)
computeImbalances(object, factor.values)
## S4 method for signature 'PocockSimonRandomizer,character'
computeImbalances(object,
factor.values)
computeOverallImbalance(object, imbalances)
## S4 method for signature 'PocockSimonRandomizer,matrix'
computeOverallImbalance(object,
imbalances)
randomizeSubject(object) <- value
## S4 replacement method for signature 'PocockSimonRandomizer,list'
randomizeSubject(object) <- value
lastRandomization(object)
## S4 method for signature 'PocockSimonRandomizer'
lastRandomization(object)
|
object |
a PocockSimonRandomizer object |
x |
the randomizer |
value |
a named list of two items: |
factor.values |
the factor values |
imbalances |
the imbalances for each treatment |
assignments |
a conformable data frame of treatment assignments so far, with appropriately named variables |
a matrix of imbalances
the imbalance
a one-row data frame of the last treatment assignment
expt
a ClinicalExperiment object defining the experiment context
seed
A seed for the random number generator for reproducibility
stateTable
A matrix of counts indicating the marginal distribution of each factor level per treatment
tr.assignments
a data frame of treatment assignments so far
tr.ratios
the treatment arm ratio, for example 2:1 in a two treatment experiment
d.func
A function that computes the imbalance for each treatment
g.func
A function that computes the overall imbalance to be minimized
p.func
A function that computes the probability vector of treatment assignments
1 2 3 4 5 6 7 8 9 | showClass("PocockSimonRandomizer")
expt <- ClinicalExperiment(number.of.factors = 2,
number.of.factor.levels = c(2, 2))
randomizer <- new("PocockSimonRandomizer", expt, 1281L)
randomizeSubject(randomizer) <- list(subject.id = "Subject 1",
factor.values = c("F1-1", "F2-2"))
randomizeSubject(randomizer) <- list(subject.id = "Subject 2",
factor.values = c("F1-2", "F2-1"))
print(randomizer)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.