randomizeR (version 1.4.2)

assess: Assessing randomization sequences

Description

Assesses randomization sequences based on specified issues in clinical trials.

Usage

assess(randSeq, ..., endp)

# S4 method for randSeq,missing assess(randSeq, ..., endp)

# S4 method for randSeq,endpoint assess(randSeq, ..., endp)

Arguments

randSeq

object of class randSeq.

...

at least one object of class issue or just a list of objects of the class issue.

endp

object of class endpoint, or missing.

Value

S4 object of class assessment summarizing the assessment of the randomization procedure.

Details

Randomization sequences behave differently with respect to issues like selection bias, chronological bias, or loss in power estimation. The assess function evaluates the behaviour 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 treamtent groups into account, e.g. for power evaluation.

See Also

Representation of randomization procedures: randPar

Generation of randomization sequences: genSeq

issues for the assessment of randomization sequences

Examples

Run this code
# NOT RUN {
# 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
endp <- normEndp(c(2, 2), c(1, 1))
issue5 <- selBias("CS", 4, "exact")
issue6 <- setPower(2, "exact")
assess(sequence, issue1, issue5, issue6, 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

# }

Run the code above in your browser using DataCamp Workspace