computeImbalances: A function to compute imbalances resulting from assigning...

Description Usage Arguments Value Author(s) References See Also Examples

Description

This function computes the imbalances resulting from assigning each of the treatments in turn for a prospective subject coming in with the factors specified

Usage

1
computeImbalances(object, factor.values)

Arguments

object

An object of class PocockSimonRandomizer

factor.values

A vector of character values specifying the level of each factor

Value

The result is an m by n matrix of values, where m is the number of factors and n is the number of treatments. The entries are what the counts of subjects assigned to each treatment would be for the levels of the factors specified. Suppose the factor levels are first level of factor 1, F1:1, third level of factor 2, F2:3, and second level of factor 3, F3:2 and there are four treatments Tr1, Tr2, Tr3, and Tr4. Then the 3 by 4 matrix has row names F1-1, F2-3, F3-2 and column names Tr1, Tr2, Tr3, Tr4. The first row would indicate the range of imbalance of subject counts (assuming default imbalance function of range) for each of the four treatments.

Author(s)

Balasubramanian Narasimhan

References

Sequential Treatment Assigment with Balancing for Prognostic Factors in the Controlled Clinical Trial, by S.~J.~Pocock and R.~Simon, Biometrics, 31, 103-115

See Also

computeOverallImbalance

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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))
computeImbalances(r.obj, c("1","2","2"))
##
## Another example
##
ex.matrix <- matrix (c(9,8,8,9,8,4,5,
                       10,7,6,11,8,5,4,
                       9,7,7,9,8,3,5), nrow=3, byrow=TRUE)

rownames(ex.matrix) <- c("Tr1", "Tr2", "Tr3")
colnames(ex.matrix) <- c("F1:1", "F1:2", "F2:1", "F2:2", "F3:1", "F3:2", "F3:3")
stateTable(r.obj) <- ex.matrix
computeImbalances(r.obj, c("1","2","2"))

SRS documentation built on May 2, 2019, 5:21 p.m.