assess {randomizeR} | R Documentation |
Assessing randomization sequences
Description
Assesses randomization sequences based on specified issues in clinical trials.
Usage
assess(randSeq, ..., endp)
## S4 method for signature 'randSeq,missing'
assess(randSeq, ..., endp)
## S4 method for signature 'randSeq,endpoint'
assess(randSeq, ..., endp)
Arguments
randSeq |
object of class |
... |
at least one object of class |
endp |
object of class |
Details
Randomization sequences behave differently with respect to issues
like selection bias, chronological bias, or loss in power estimation.
The assess
function evaluates the behavior of randomization
sequences with respect to these issues.
The first argument should be a result of one of the functions
genSeq
or getAllSeq
.
The second argument should be any number of issues
arising
in a clinical trial. The last argument endp
may be provided if
the assessment should take the distribution of the treatment groups
into account, e.g. for power evaluation.
Value
S4
object of class assessment
summarizing the assessment of the
randomization procedure.
See Also
Representation of randomization procedures: randPar
Generation of randomization sequences: genSeq
issues
for the assessment of randomization sequences
Examples
# assess the full set of Random Allocation Rule for N=4 patients
sequences <- getAllSeq(rarPar(4))
issue1 <- corGuess("CS")
issue2 <- corGuess("DS")
issue3 <- imbal("imb")
issue4 <- imbal("maxImb")
assess(sequences, issue1, issue2, issue3, issue4)
# assess one sequence of the Big Stick Design with respect to correct guesses
sequence <- genSeq(bsdPar(10, 2), seed = 1909)
assess(sequence, issue1)
# assess the same sequence with respect to selection bias and power for a normal endpoint
endp <- normEndp(c(2, 2), c(1, 1))
issue5 <- selBias("CS", 4, "exact")
issue6 <- setPower(2, "exact")
assess(sequence, issue1, issue5, issue6, endp = endp)
# assess the same sequence with respect to selection bias for an exponential endpoint
endp <- expEndp(lambda = c(0.5, 0.5), cenRate=0.1, accrualTime=1, cenTime=5)
issue7 <- selBias("CS", 0.1, "exact")
assess(sequence, issue1, issue7, endp = endp)
# recommended plot for the assessment of rejection probabilities
RP <- getAllSeq(crPar(6))
cB <- chronBias(type = "linT", theta = 1/6, method = "exact")
sB <- selBias(type= "CS", eta = 1/4, method = "exact")
normEndp <- normEndp(c(0, 0), c(1, 1))
A <- assess(RP, cB, sB, endp = normEndp)
D <- A$D
desiredSeq <- round(sum(D[,2][D[,3] <= 0.05 & D[,4] <= 0.05]), digits = 4)
colnames(D) <- c("Seq", "Prob", "SB", "linT")
g <- ggplot(D, aes(x = SB, y = linT))
g <- g + annotate("rect", xmin = 0, xmax = 0.05, ymin = 0, ymax = 0.05,
alpha=0.2, fill="green")
g <- g + geom_point(alpha = 1/10, size = 3, col = "orange")
g <- g <- g + geom_vline(xintercept = 0.05, col = "red")
g <- g + geom_hline(yintercept = 0.05, col = "red")
g <- g + geom_text(data = NULL, x = 0, y = 0,
label = paste("Proportion:", desiredSeq), hjust=0, vjust=0, size = 7)
g