Title: | Randomization for Clinical Trials |
---|---|
Description: | This tool enables the user to choose a randomization procedure based on sound scientific criteria. It comprises the generation of randomization sequences as well the assessment of randomization procedures based on carefully selected criteria. Furthermore, 'randomizeR' provides a function for the comparison of randomization procedures. |
Authors: | David Schindler [aut], Diane Uschner [aut], Denis Razsolkov [ctb], Dimitar Mihaylov [ctb], Marcia Viviane Rueckbeil [ctb], Martin Manolov [ctb], Thi Mui Pham [ctb], Michael Martini [ctb], Ralf-Dieter Hilgers [aut, ths, cre], Nicole Heussen [aut, ths], Daniel Bodden [ctb] |
Maintainer: | Ralf-Dieter Hilgers <[email protected]> |
License: | GPL (>= 3) |
Version: | 3.0.2 |
Built: | 2024-11-12 06:54:14 UTC |
Source: | CRAN |
This tool enables the user to choose a randomization procedure based on sound scientific criteria. It comprises the generation of randomization sequences as well the assessment of randomization procedures based on carefully selected criteria. Furthermore, randomizeR provides a function for the comparison of randomization procedures.
This research is embedded in the IDeAl project, which has received funding from the European Union's Seventh Framework Programme for research, technological development and demonstration under Grant Agreement no 602552.
David Schindler [email protected], Diane Uschner [email protected], Ralf-Dieter Hilgers, Nicole Heussen, Marcia Viviane Rueckbeil [email protected]
W. F. Rosenberger and J. M. Lachin (2002) Randomization in Clinical Trials. Wiley.
#' D. Uschner, D. Schindler, R. D. Hilgers and N. Heussen (2018). "randomizeR: An R Package for the Assessment and Implementation of Randomization in Clinical Trials." Journal of Statistical Software, 85(8), pp. 1-22. doi: 10.18637/jss.v085.i08 .
D. Schindler (2016) Assessment of Randomization Procedures in the Presence of Selection and Chronological Bias. PhD Thesis.
D. Uschner, R. D. Hilgers, N. Heussen (2018). "The impact of selection bias in randomized multi-arm parallel group clinical trials." PLOS ONE, 13(1): e0192065. doi: 10.1371/journal.pone.0192065.
M. V. Rueckbeil, R. D. Hilgers, N. Heussen (2019). "Randomization in survival studies: An evaluation method that takes into account selection and chronological bias." PLOS ONE, 14(6): e0217946. doi: 10.1371/journal.pone.0217946.
For functionality for randomization procedures, see randPar
and
genSeq
.
For the criteria for the assessment of randomization procedures, see
issues
.
For the assessment and comparison of randomization procedures, see
assess
and compare
.
Function returning the adjusting parameter a slot of an S4 object
a(obj)
a(obj)
obj |
object of class randPar |
the value of the adjusting parameter a
of an
S4
object
Represents the randomization procedure Accelerated Biased Coin Design.
abcdPar(N, a, groups = LETTERS[1:2])
abcdPar(N, a, groups = LETTERS[1:2])
N |
integer for the total sample size of the trial. |
a |
nonnegative parameter which controls the degree of randomness:
For decreasing |
groups |
character vector of labels for the different treatments. |
This is a class of 'biased coins' where the probability of selecting the under-represented treatment is dependent from the absolute difference between the two treatment allocations up to the current step.
S4
object of the class abcdPar
.
A. B. Antognini and A. Giovagnoli (2004) A new 'biased coin design' for the sequential allocation of two treatments. Journal of the Royal Statistical Society. Series C (Applied Statistics) 53, No. 4, 651-664
Other randomization procedures:
bbcdPar
,
bsdPar
,
chenPar
,
crPar
,
createParam()
,
ebcPar
,
gbcdPar
,
hadaPar
,
mpPar
,
pbrPar
,
rarPar
,
rpbrPar
,
rtbdPar
,
tbdPar
,
udPar
Creates stratified sequences Compares stratified sequences to their respective non-stratified version under the influence of bias.
endp |
object of class |
pr |
at least one object of class |
Stratified and Non-stratified versions of a randomization sequence behave differently with respect to issues like selection bias, chronological bias or combined bias.
The analyse
function creates both versions of a sequence for each of the specified randomization procedures and analyses them in relation to the bias created according to the theta
and eta
values.
The first argument should specify the total sample size of patients. The second argument should be one of class normEndp
describing a normally distributed endpoint.
The third argument should be the allocation ratio for the different strata. The fourth argument should be the number of strata in the clinical trial. The fifth and sixth arguments should be the selection bias effect eta and the time trend theta.
The seventh argument should be a vector of strings representing different randomization procedures. The strings should be given as described by the getDesign
function. Any additional parameters should be given after the design name of the procedure encapsulated in parenthesis.
The function returns a matrix that summarizes the performance of the randomization procedures. The values for each randomization procedure represent the percentage of sequences that kept the 5
Assesses randomization sequences based on specified issues in clinical trials.
assess(randSeq, ..., endp) ## S4 method for signature 'randSeq,missing' assess(randSeq, ..., endp) ## S4 method for signature 'randSeq,endpoint' assess(randSeq, ..., endp)
assess(randSeq, ..., endp) ## S4 method for signature 'randSeq,missing' assess(randSeq, ..., endp) ## S4 method for signature 'randSeq,endpoint' assess(randSeq, ..., endp)
randSeq |
object of class |
... |
at least one object of class |
endp |
object of class |
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.
S4
object of class assessment
summarizing the assessment of the
randomization procedure.
Representation of randomization procedures: randPar
Generation of randomization sequences: genSeq
issues
for the assessment of randomization sequences
# 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
# 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
Represents the randomization procedure Bayesian Biased Coin Design.
bbcdPar(N, a, groups = LETTERS[1:2])
bbcdPar(N, a, groups = LETTERS[1:2])
N |
integer for the total sample size of the trial. |
a |
nonnegative parameter which controls the degree of randomness:
For decreasing |
groups |
character vector of labels for the different treatments. |
Extension of Efron's biased coin design.
S4
object of the class bbcdPar
.
A. B. Antognini and Maroussa Zagoraiou (2014) Balance and randomness in sequential clinical trials: the dominant biased coin design. Pharmaceutical Statistics 13(2), 119-127
Other randomization procedures:
abcdPar
,
bsdPar
,
chenPar
,
crPar
,
createParam()
,
ebcPar
,
gbcdPar
,
hadaPar
,
mpPar
,
pbrPar
,
rarPar
,
rpbrPar
,
rtbdPar
,
tbdPar
,
udPar
Function returning the block slot of an S4 object
blocks(obj)
blocks(obj)
obj |
object of class pbrPar |
a vector with the lenghts of each block of a pbrPar
object
Represents the randomization procedure Big Stick Design.
bsdPar(N, mti, groups = LETTERS[1:2])
bsdPar(N, mti, groups = LETTERS[1:2])
N |
integer for the total sample size of the trial. |
mti |
maximum tolerated imbalance in patient numbers during the trial. |
groups |
character vector of labels for the different treatments. |
Tossing a fair coin as long as the difference in group sizes does not
exceed the mti
. If the mti
is reached a deterministic
allocation is done, so that the difference in group sizes is reduced.
S4
object of the class bsdPar
.
J. F. Soares and C. F. Jeff Wu (1983) Some Restricted Randomization Rules in Sequential Designs. Comm. in Stat., 12, 2017-34.
Other randomization procedures:
abcdPar
,
bbcdPar
,
chenPar
,
crPar
,
createParam()
,
ebcPar
,
gbcdPar
,
hadaPar
,
mpPar
,
pbrPar
,
rarPar
,
rpbrPar
,
rtbdPar
,
tbdPar
,
udPar
Represents the randomization procedure Chen's Design.
chenPar(N, mti = N, p = 0.5, groups = LETTERS[1:2])
chenPar(N, mti = N, p = 0.5, groups = LETTERS[1:2])
N |
integer for the total sample size of the trial. |
mti |
maximum tolerated imbalance in patient numbers during the trial. |
p |
success probability of the biased coin (e.g. in Efron's Biased Coin Design). |
groups |
character vector of labels for the different treatments. |
Flip a biased coin with probability p
in favor of the treatment
which is allocated less frequently as long as the difference in group sizes does
not exceed the mti
. If the mti
is reached a deterministic
allocation is done, so that the difference in group sizes is reduced.
If both treatments have been assigned equally often a fair coin is tossed.
S4
object of the class chenPar
.
Chen Yung-Pin (1999) Biased coin design with imbalance tolerance. Comm. in Stat., 15, 953-975.
Other randomization procedures:
abcdPar
,
bbcdPar
,
bsdPar
,
crPar
,
createParam()
,
ebcPar
,
gbcdPar
,
hadaPar
,
mpPar
,
pbrPar
,
rarPar
,
rpbrPar
,
rtbdPar
,
tbdPar
,
udPar
Represents the issue of chronological bias in a clinical trial.
chronBias(type, theta, method, saltus, alpha = 0.05)
chronBias(type, theta, method, saltus, alpha = 0.05)
type |
character string, should be one of " |
theta |
factor of the time trend for further details see |
method |
character string, should be one of |
saltus |
integer or |
alpha |
significance level |
Chronological bias can be an issue in the design of a clinical trial. The
chronBias
function is a constructor function
for an S4 object of the class chronBias
representing the issue of
chronological bias, s.a. time trends, in a clinical trial. It supports two possible modes,
method="sim"
and method="exact"
, and three different types of trend.
If method="sim"
, the object represents the simulated type-I-error rate given
the level alpha
, the selection effect eta
and the biasing
strategy type
. When calling assess
for a chronBias
object
with method="sim"
, one test decision is computed for each sequence of
randSeq
. The type-I-error rate (power) is the proportion of falsely
(correctly) rejected null hypotheses.
If method="exact"
, the object represents the exact type-I-error probability
given the level alpha
, the selection effect eta
and the
biasing strategy type
. When calling assess
for a chronBias
object with method="exact"
, the p-value of each randomization
sequence is computed. For normal endpoints and two treatment groups these p-values
are exact values which can be calculated from the sum of the corresponding quantiles
of the doubly noncentral t-distribution. For more than two treatment groups, exact
p-values are computed using a doubly noncentral F distribution. For exponential
endpoints the p-values are obtained using an approximation formula.
type = "linT"
Represents linear time trend. Linear time trend means that the time trend function of the patients,
i.e. expected response for normal endpoints, increases evenly by theta/(N-1)
with
every patient included in the study, until reaching theta
after N
patients.
Linear time trend may occur as a result of gradually relaxing in- or exclusion criteria
throughout the trial.
It can be represented by the formula:
type = "logT"
Represents logarithmic time trend. Logarithmic time trend means that the time trend function of
the patients, i.e. expected response for normal endpoints, increases logarithmically in the
patient index by theta/log(N)
with every patient included in the study, until reaching
theta
after N
patients. Logarithmic time trend may occur as a result of a learning
curve, i.e. in a surgical trial.
It can be represented by the formula:
type = "stepT"
Represents step trend. Step trend means that the expected response of the patients increases
by theta
after a given point ("saltus"
) in the allocation process.
Step trend may occur if a new device is used after the point =
"saltus"
, or if
the medical personal changes after this point.
Step time trend can be represented by the formula:
S4
object of class chronBias
, a formal representation of the
issue of chronological bias in a clinical trial.
G. K. Rosenkranz (2011) The impact of randomization on the analysis of clinical trials. Statistics in Medicine, 30, 3475-87.
M. Tamm and R.-D. Hilgers (2014) Chronological bias in randomized clinical trials under different types of unobserved time trends. Methods of Information in Medicine, 53, 501-10.
Other issues:
combineBias()
,
corGuess
,
imbal
,
issue
,
selBias
,
setPower()
# create a linear time trend with theta = 0.5 for which the exact rejection probabilities # are calculated cbias <- chronBias("linT", 0.5, "exact") # create a stepwise time trend with theta = 1 after 10 allocations for which the test # decision is simulated cbias <- chronBias("stepT", 1, "sim", 10)
# create a linear time trend with theta = 0.5 for which the exact rejection probabilities # are calculated cbias <- chronBias("linT", 0.5, "exact") # create a stepwise time trend with theta = 1 after 10 allocations for which the test # decision is simulated cbias <- chronBias("stepT", 1, "sim", 10)
Function returning the coin slot of an S4 object
coin(obj)
coin(obj)
obj |
object extending class randPar or randSeq |
The success probability of the biased coin
This class combines a selBias
object and a chronBias
object
to a new object. In the analysis within the new object the
two types of bias are treated as additive effect for normal endpoints
and as multiplicative effect for exponential endpoints.
combineBias(selBias, chronBias)
combineBias(selBias, chronBias)
selBias |
object of class |
chronBias |
object of class |
A combined bias object that combines a selBias
and
a chronBias
object
Other issues:
chronBias
,
corGuess
,
imbal
,
issue
,
selBias
,
setPower()
chronBias <- chronBias(type="linT", theta=1, method="sim") selBias <- selBias(type="CS", eta=1, method="sim") combineBias(selBias, chronBias)
chronBias <- chronBias(type="linT", theta=1, method="sim") selBias <- selBias(type="CS", eta=1, method="sim") combineBias(selBias, chronBias)
Compares randomization procedures based on a specified issue in clinical trials.
compare(issue, ..., endp) ## S4 method for signature 'issue,missing' compare(issue, ..., endp) ## S4 method for signature 'issue,endpoint' compare(issue, ..., endp)
compare(issue, ..., endp) ## S4 method for signature 'issue,missing' compare(issue, ..., endp) ## S4 method for signature 'issue,endpoint' compare(issue, ..., endp)
issue |
object of class |
... |
at least one object of class |
endp |
object of class |
Randomization procedures behave differently with respect to issues
like selection bias, chronological bias, or loss in power estimation.
The compare
function evaluates the behavior of randomization
procedures with respect to one issue.
Its first argument should represent one of the implemented
issues
.
The second argument should be any number of objects of the class
randSeq
. These objects represent the randomization procedures
for the planned comparison.
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.
S4
object of class comparison
summarizing the comparison of the
randomization procedures.
Representation of randomization procedures: randPar
Generation of randomization sequences: genSeq
issues
for the assessment of randomization sequences
# compare Random Allocation Rule and Big Stick for N = 4 with respect to # correct guesses RAR <- getAllSeq(rarPar(4)) BSD <- getAllSeq(bsdPar(4, mti = 2)) corGuess <- corGuess("CS") (comp <- compare(corGuess, RAR, BSD)) plot(comp) # compare the same procedures with respect to selection bias for a normal endpoint endp <- normEndp(c(2, 2), c(1, 1)) selBias <- selBias("CS", 4, "exact") (comp <- compare(selBias, RAR, BSD, endp = endp)) plot(comp) # compare the same procedures with respect to selection bias for an exponential endpoint endp <- expEndp(lambda = c(0.5, 0.5), cenRate=0.1, accrualTime=1, cenTime=5) selBias <- selBias("CS", 0.1, "exact") (comp <- compare(selBias, RAR, BSD, endp = endp)) plot(comp)
# compare Random Allocation Rule and Big Stick for N = 4 with respect to # correct guesses RAR <- getAllSeq(rarPar(4)) BSD <- getAllSeq(bsdPar(4, mti = 2)) corGuess <- corGuess("CS") (comp <- compare(corGuess, RAR, BSD)) plot(comp) # compare the same procedures with respect to selection bias for a normal endpoint endp <- normEndp(c(2, 2), c(1, 1)) selBias <- selBias("CS", 4, "exact") (comp <- compare(selBias, RAR, BSD, endp = endp)) plot(comp) # compare the same procedures with respect to selection bias for an exponential endpoint endp <- expEndp(lambda = c(0.5, 0.5), cenRate=0.1, accrualTime=1, cenTime=5) selBias <- selBias("CS", 0.1, "exact") (comp <- compare(selBias, RAR, BSD, endp = endp)) plot(comp)
Represents the expected number of correct guesses of randomization sequences.
corGuess(type)
corGuess(type)
type |
character string, should be one of |
Selection bias can be an issue in the design of a clinical trial. The
expected number of correct guesses is one measure for selection bias.
The corGuess
function is a constructor function
for an S4 object of the class corGuess
representing the issue of
correct guesses in a clinical trial. The parameter type
takes the
following values:
"CS"
refers to "convergence strategy", i.e. the investigator predicts the treatment which has hitherto occurred less often.
"DS"
refers to "divergence strategy", i.e. the investigator predicts the treatment which has hitherto occurred more often.
S4
object of class corGuess
, a formal representation of the
issue of correct guesses in a clinical trial.
D. Blackwell and J.L. Hodges Jr. (1957) Design for the control of selection bias. Annals of Mathematical Statistics, 25, 449-60.
Other issues:
chronBias
,
combineBias()
,
imbal
,
issue
,
selBias
,
setPower()
Represents any randomization procedure for a two-armed clinical trial.
createParam(method, N, mti, bc, rb, p, ini, add, filledBlock)
createParam(method, N, mti, bc, rb, p, ini, add, filledBlock)
method |
method that is used to generate the (random) allocation
sequence. It can take values |
N |
integer for the total sample size of the trial. |
mti |
maximum tolerated imbalance in patient numbers during the trial. |
bc |
vector which contains the lengths |
rb |
block lengths of the blocks that can be selected equiprobable at random. |
p |
success probability of the biased coin (e.g. in Efron's Biased Coin Design). |
ini |
integer representing the initial urn composition. |
add |
integer representing the number of balls that are added to the urn in each step. |
filledBlock |
|
Depending on the input of the user, createParam
creates an object
representing a randomization procedures for a two-armed clinical trial
(see also randPar
).
S4object of the corresponding randomization procedure class.
Other randomization procedures:
abcdPar
,
bbcdPar
,
bsdPar
,
chenPar
,
crPar
,
ebcPar
,
gbcdPar
,
hadaPar
,
mpPar
,
pbrPar
,
rarPar
,
rpbrPar
,
rtbdPar
,
tbdPar
,
udPar
This function is a query to create an corresponding randomization sequence
for a two-armed clinical trial. If
file
is defined, the generated sequence is automatically saved to the
corresponding path.
createSeq(file)
createSeq(file)
file |
A connection, or a character string naming the file to write to. |
an object Param
, which is available
Represents the randomization procedure Complete Randomization.
crPar(N, K = 2, ratio = rep(1, K), groups = LETTERS[1:K])
crPar(N, K = 2, ratio = rep(1, K), groups = LETTERS[1:K])
N |
integer for the total sample size of the trial. |
K |
number of treatment groups (e.g. K=2 if we compare one experimental against one control treatment). |
ratio |
vector of length |
groups |
character vector of labels for the different treatments. |
Toss a fair coin N
times in case K=2
and assign the treatments according to the result of the coin. In case of K>2
, replace the coin by a die with K
sides.
S4
object of the class crPar
.
W. F. Rosenberger and J. M. Lachin (2002) Randomization in Clinical Trials. Wiley.
Other randomization procedures:
abcdPar
,
bbcdPar
,
bsdPar
,
chenPar
,
createParam()
,
ebcPar
,
gbcdPar
,
hadaPar
,
mpPar
,
pbrPar
,
rarPar
,
rpbrPar
,
rtbdPar
,
tbdPar
,
udPar
Represents the Derringer-Suich desirability approach.
derFunc(TV, SLs, b)
derFunc(TV, SLs, b)
TV |
numeric specifying the optimal desired value called the target value. |
SLs |
numeric vector of length at most 2 specifying the lower and/or upper specified border. |
b |
numeric vector of length at most 2 specifying the weight(s) for the punishment of deviations from the target value. |
derFunc represents the framework for left, right and two-sided desirability functions
introduced by Derringer and Suich (1980). For all three different kinds of desirability
functions the parameter TV
must be specified. If the parameter SLs
has
length 1, either the left- or right-sided desirability function is created depending
from whether the value is smaller (left-sided) or greater (right-sided) than the target
value. By specifying SLs
as a vector of length 2 a two-sided desirability
function is created where the lower specified border is determined as the smaller value
of SLs
and thus the upper specified border is determined as the greater value.
If there are no values specified for the weights, then they are automatically set to 1
(linear loss).
S4
object of class derFunc
, a formal representation of desirability
functions introduced by Derringer and Suich.
Derringer, G., and Suich, R., (1980) Simultaneous Optimization of Several Response Variables. Journal of Quality Technology, 12, 214-219.
Other desirability topics:
evaluate()
,
getDesScores()
,
plotDes()
,
plotEv()
,
probUnDes()
# create an object of a left-sided desirability function dLeft <- derFunc(0.5, 0.3, 2) # create an object of a right-sided desirability function dRight <- derFunc(0.5, 0.8, 1) # create an object of a two-sided desirability function dLR <- derFunc(0.5, c(0.3, 0.9), c(3, 1))
# create an object of a left-sided desirability function dLeft <- derFunc(0.5, 0.3, 2) # create an object of a right-sided desirability function dRight <- derFunc(0.5, 0.8, 1) # create an object of a two-sided desirability function dLR <- derFunc(0.5, c(0.3, 0.9), c(3, 1))
Illustrates the interplay between functions related to desirability indices.
Currently, randomizeR
encompasses the class of desirability functions introduced
by Derringer and Suich (1980) and corresponding functions to evaluate and compare
randomization sequences which have been assessed on the basis of desirability indices
of specific issues:
derFunc represents the class of desirability functions according to Derringer-Suich (1980).
getDesScores
can be applied to an object of class assessment
together with prespecified
desirability functions to compare the behavior of randomization sequences (on a
common scale \[0,1\]).
plotDes
plots a desScores
object on a radar chart.
evaluate
performs a comparison of sequences from different randomization sequences on the
basis of object of the class desScores
.
plotEv
plots an evaluation
object on a radar chart.
probUnDes computes the probability of undesired randomization sequences with respect to certain issues and desirability functions.
# perform a comparison of randomization sequences from different randomization procedures # with the help of desirability functions issue1 <- corGuess("CS") issue2 <- chronBias(type = "linT", theta = 1/4, method = "exact") RAR <- getAllSeq(rarPar(4)) BSD <- getAllSeq(bsdPar(4, mti = 2)) A1 <- assess(RAR, issue1, issue2, endp = normEndp(c(0,0), c(1,1))) A2 <- assess(BSD, issue1, issue2, endp = normEndp(c(0,0), c(1,1))) d1 <- derFunc(TV = 0.5, 0.75, 2) d2 <- derFunc(0.05, c(0, 0.1), c(1, 1)) # apply the getDesScores function to the assessment output with the specified desirability # functions to evaluate the behaviour of randomization sequences on a [0,1] scale DesScore <- getDesScores(A1, d1, d2, weights = c(5/6, 1/6)) DesScore2 <- getDesScores(A2, d1, d2, weights = c(5/6, 1/6)) # plotting the desScores objects plotDes(DesScore, quantiles = TRUE) plotDes(DesScore2, quantiles = TRUE) # summarize the results of getDesScore with respect to the statistic "mean" evaluate(DesScore, DesScore2) # plot the evaluation objects for a visualized comparison plotEv(evaluate(DesScore, DesScore2)) # display which randomzation procedure produces more undesired randomization sequences # with respect to certain issues and desirability functions probUnDes(DesScore) probUnDes(DesScore2)
# perform a comparison of randomization sequences from different randomization procedures # with the help of desirability functions issue1 <- corGuess("CS") issue2 <- chronBias(type = "linT", theta = 1/4, method = "exact") RAR <- getAllSeq(rarPar(4)) BSD <- getAllSeq(bsdPar(4, mti = 2)) A1 <- assess(RAR, issue1, issue2, endp = normEndp(c(0,0), c(1,1))) A2 <- assess(BSD, issue1, issue2, endp = normEndp(c(0,0), c(1,1))) d1 <- derFunc(TV = 0.5, 0.75, 2) d2 <- derFunc(0.05, c(0, 0.1), c(1, 1)) # apply the getDesScores function to the assessment output with the specified desirability # functions to evaluate the behaviour of randomization sequences on a [0,1] scale DesScore <- getDesScores(A1, d1, d2, weights = c(5/6, 1/6)) DesScore2 <- getDesScores(A2, d1, d2, weights = c(5/6, 1/6)) # plotting the desScores objects plotDes(DesScore, quantiles = TRUE) plotDes(DesScore2, quantiles = TRUE) # summarize the results of getDesScore with respect to the statistic "mean" evaluate(DesScore, DesScore2) # plot the evaluation objects for a visualized comparison plotEv(evaluate(DesScore, DesScore2)) # display which randomzation procedure produces more undesired randomization sequences # with respect to certain issues and desirability functions probUnDes(DesScore) probUnDes(DesScore2)
Represents the randomization procedure Efron's Biased Coin Design.
ebcPar(N, p, groups = LETTERS[1:2])
ebcPar(N, p, groups = LETTERS[1:2])
N |
integer for the total sample size of the trial. |
p |
success probability of the biased coin (e.g. in Efron's Biased Coin Design). |
groups |
character vector of labels for the different treatments. |
Flip a biased coin with probability p
in favor of the treatment
which is allocated less frequently. If both treatments have been assigned
equally often a fair coin is tossed.
S4
object of the class ebcPar
.
B. Efron (1971) Forcing a sequential experiment to be balanced. Biometrika, 58, 403-17.
Other randomization procedures:
abcdPar
,
bbcdPar
,
bsdPar
,
chenPar
,
crPar
,
createParam()
,
gbcdPar
,
hadaPar
,
mpPar
,
pbrPar
,
rarPar
,
rpbrPar
,
rtbdPar
,
tbdPar
,
udPar
Evaluation of several randomization procedures with respect to certain desirability functions applied to specified issues.
evaluate(..., statistic) ## S4 method for signature 'missing' evaluate(..., statistic) ## S4 method for signature 'character' evaluate(..., statistic)
evaluate(..., statistic) ## S4 method for signature 'missing' evaluate(..., statistic) ## S4 method for signature 'character' evaluate(..., statistic)
... |
at least one object of the class |
statistic |
character string that specifies on the basis of which statistic the
|
The evaluate
function allows the user to compare and evaluate different
randomization procedures. It expects a number of objects that result when applying the
getDesScores
function to an assess object and specified desirability functions.
The evaluate
function summarizes the desirability scores of each randomization
procedure on the basis of a prespecified statistic and incorporates them into a data
frame. If no statistic is specified then it is automatically set to mean
. If
the function is applied to only one object it corresponds simply to
summary(getDesScores(...))
.
S4
object of class evaluation
Comparison of randomization procedures
with respect to desirability functions applied to specified issues, summarized by a
prespecified statistic.
D. Schindler Assessment of Randomization Procedures in the Presence of Selection and Chronological Bias. PhD Thesis.
Representation of randomization procedures: randPar
Generation of randomization sequences: genSeq
issues
for the desirability of randomization sequences
Other desirability topics:
derFunc
,
getDesScores()
,
plotDes()
,
plotEv()
,
probUnDes()
# compare Random Allocation Rule to Big Stick Design with respect to different issues # and their corresponding desirability functions issue1 <- corGuess("CS") issue2 <- corGuess("DS") RAR <- getAllSeq(rarPar(4)) BSD <- getAllSeq(bsdPar(4, mti = 2)) A1 <- assess(RAR, issue1, issue2) A2 <- assess(BSD, issue1, issue2) d1 <- derFunc(TV = 0.1, 0.7, 2) d2 <- derFunc(0.5, c(0.3, 0.8), c(1, 1)) DesScore <- getDesScores(A1, d1, d2, weights = c(5/6, 1/6)) DesScore2 <- getDesScores(A2, d1, d2, weights = c(5/6, 1/6)) evaluate(DesScore, DesScore2) evaluate(DesScore, DesScore2, statistic = "max")
# compare Random Allocation Rule to Big Stick Design with respect to different issues # and their corresponding desirability functions issue1 <- corGuess("CS") issue2 <- corGuess("DS") RAR <- getAllSeq(rarPar(4)) BSD <- getAllSeq(bsdPar(4, mti = 2)) A1 <- assess(RAR, issue1, issue2) A2 <- assess(BSD, issue1, issue2) d1 <- derFunc(TV = 0.1, 0.7, 2) d2 <- derFunc(0.5, c(0.3, 0.8), c(1, 1)) DesScore <- getDesScores(A1, d1, d2, weights = c(5/6, 1/6)) DesScore2 <- getDesScores(A2, d1, d2, weights = c(5/6, 1/6)) evaluate(DesScore, DesScore2) evaluate(DesScore, DesScore2, statistic = "max")
Represents exponentially distributed endpoints in clinical trials.
expEndp(lambda, cenRate, accrualTime = 0, cenTime)
expEndp(lambda, cenRate, accrualTime = 0, cenTime)
lambda |
vector of the exponential rate parameters in each treatment group. |
cenRate |
exponential censoring rate in a survival study. |
accrualTime |
duration of the accrual period in a survival study. |
cenTime |
total duration of a survival study (maximum length of followup). |
The expEnd
function is a constructor function
for an S4 object of the class expEnd
representing
an exponentially distributed endpoint in a clinical trial.
In conjunction with the assess function, exponential endpoints
admit the calculation of the 'exact' type-I-error probability and power
using an approximation formula.
A S4
object representing
an exponentially distributed endpoint in a clinical trial.
Compute exact or simulated type-I-error: assess
.
Other endpoint types:
normEndp
,
survEndp
# set the parameters of two exponentially distributed endpoints endp <- expEndp(lambda = c(1, 2), cenTime = 10, cenRate = 0.01)
# set the parameters of two exponentially distributed endpoints endp <- expEndp(lambda = c(1, 2), cenTime = 10, cenRate = 0.01)
Represents the randomization procedure Generalized Biased Coin Design.
gbcdPar(N, rho, groups = LETTERS[1:2])
gbcdPar(N, rho, groups = LETTERS[1:2])
N |
integer for the total sample size of the trial. |
rho |
nonnegative parameter which my be adjusted according to how strongly it is
desired to balance the experiment. If |
groups |
character vector of labels for the different treatments. |
Generalization of Wei's urn and Efron's biased coin design.
S4
object of the class gbcdPar
.
R. L. Smith (1984) Sequential treatment allocation using biased coin designs.
Journal of the Royal Statistical Society B,
46, 519-543.
W. F. Rosenberger and J. M. Lachin (2002) Randomization in Clinical Trials. Wiley,
64-65
Other randomization procedures:
abcdPar
,
bbcdPar
,
bsdPar
,
chenPar
,
crPar
,
createParam()
,
ebcPar
,
hadaPar
,
mpPar
,
pbrPar
,
rarPar
,
rpbrPar
,
rtbdPar
,
tbdPar
,
udPar
Computes all randomization sequences for the given randomization procedure, and stores them in an object along with the parameters belonging to the randomization procedure.
getAllSeq(obj) ## S4 method for signature 'pbrPar' getAllSeq(obj) ## S4 method for signature 'rarPar' getAllSeq(obj) ## S4 method for signature 'abcdPar' getAllSeq(obj) ## S4 method for signature 'bbcdPar' getAllSeq(obj) ## S4 method for signature 'ebcPar' getAllSeq(obj) ## S4 method for signature 'bsdPar' getAllSeq(obj) ## S4 method for signature 'chenPar' getAllSeq(obj) ## S4 method for signature 'crPar' getAllSeq(obj) ## S4 method for signature 'gbcdPar' getAllSeq(obj) ## S4 method for signature 'hadaPar' getAllSeq(obj) ## S4 method for signature 'mpPar' getAllSeq(obj) ## S4 method for signature 'tbdPar' getAllSeq(obj) ## S4 method for signature 'udPar' getAllSeq(obj)
getAllSeq(obj) ## S4 method for signature 'pbrPar' getAllSeq(obj) ## S4 method for signature 'rarPar' getAllSeq(obj) ## S4 method for signature 'abcdPar' getAllSeq(obj) ## S4 method for signature 'bbcdPar' getAllSeq(obj) ## S4 method for signature 'ebcPar' getAllSeq(obj) ## S4 method for signature 'bsdPar' getAllSeq(obj) ## S4 method for signature 'chenPar' getAllSeq(obj) ## S4 method for signature 'crPar' getAllSeq(obj) ## S4 method for signature 'gbcdPar' getAllSeq(obj) ## S4 method for signature 'hadaPar' getAllSeq(obj) ## S4 method for signature 'mpPar' getAllSeq(obj) ## S4 method for signature 'tbdPar' getAllSeq(obj) ## S4 method for signature 'udPar' getAllSeq(obj)
obj |
object specifying the randomization procedure, see |
getAllSeq
is a generic function which dispatches different
methods depending on the type of input. The set of sequences of a procedure
is computed by enumerating all possible sequences and eliminating those that
are not possible in the randomization procedure specified by obj
. The
parameters of the randomization procedure are saved along with the sequences
to ensure reproducibility of the results.
An object inheriting from randSeq, representing the set
of randomization sequences for the given parameters.
The output consists of the parameters used for the generation of the
randomization sequences (see createParam
) and the matrix M
that stores the randomization sequences in its rows.
# all randomization sequences of Efron's Biased Coin Design with p = 0.667 for N = 6 myPar <- ebcPar(6, 0.667) getAllSeq(myPar) # all randomization sequences of Big Stick Design with mti = 2 for N = 6 myPar <- bsdPar(6, 2) getAllSeq(myPar) # all randomization sequences of Permuted Block Randomization with block sizes 4 and 2 myPar <- pbrPar(c(4, 2)) getAllSeq(myPar)
# all randomization sequences of Efron's Biased Coin Design with p = 0.667 for N = 6 myPar <- ebcPar(6, 0.667) getAllSeq(myPar) # all randomization sequences of Big Stick Design with mti = 2 for N = 6 myPar <- bsdPar(6, 2) getAllSeq(myPar) # all randomization sequences of Permuted Block Randomization with block sizes 4 and 2 myPar <- pbrPar(c(4, 2)) getAllSeq(myPar)
Generates randomization sequences from a given randomization procedure.
genSeq(obj, r, seed) ## S4 method for signature 'pbrPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'pbrPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'pbrPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'pbrPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'rarPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'rarPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'rarPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'rarPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'abcdPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'abcdPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'abcdPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'abcdPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'bbcdPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'bbcdPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'bbcdPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'bbcdPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'ebcPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'ebcPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'ebcPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'ebcPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'bsdPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'bsdPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'bsdPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'bsdPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'chenPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'chenPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'chenPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'chenPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'crPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'crPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'crPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'crPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'gbcdPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'gbcdPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'gbcdPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'gbcdPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'hadaPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'hadaPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'hadaPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'hadaPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'mpPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'mpPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'mpPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'mpPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'rpbrPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'rpbrPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'rpbrPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'rpbrPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'tbdPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'tbdPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'tbdPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'tbdPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'rtbdPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'rtbdPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'rtbdPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'rtbdPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'udPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'udPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'udPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'udPar,missing,missing' genSeq(obj, r, seed)
genSeq(obj, r, seed) ## S4 method for signature 'pbrPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'pbrPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'pbrPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'pbrPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'rarPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'rarPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'rarPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'rarPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'abcdPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'abcdPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'abcdPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'abcdPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'bbcdPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'bbcdPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'bbcdPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'bbcdPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'ebcPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'ebcPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'ebcPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'ebcPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'bsdPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'bsdPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'bsdPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'bsdPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'chenPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'chenPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'chenPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'chenPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'crPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'crPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'crPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'crPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'gbcdPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'gbcdPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'gbcdPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'gbcdPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'hadaPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'hadaPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'hadaPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'hadaPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'mpPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'mpPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'mpPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'mpPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'rpbrPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'rpbrPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'rpbrPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'rpbrPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'tbdPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'tbdPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'tbdPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'tbdPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'rtbdPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'rtbdPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'rtbdPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'rtbdPar,missing,missing' genSeq(obj, r, seed) ## S4 method for signature 'udPar,numeric,numeric' genSeq(obj, r, seed) ## S4 method for signature 'udPar,missing,numeric' genSeq(obj, r, seed) ## S4 method for signature 'udPar,numeric,missing' genSeq(obj, r, seed) ## S4 method for signature 'udPar,missing,missing' genSeq(obj, r, seed)
obj |
object specifying the randomization procedure, see |
r |
numeric indicating the number of random sequences to be generated at random, or missing. |
seed |
a single value, interpreted as an integer, that specifies the seed for the random number generation. |
genSeq
generates randomization sequences for a randomization
procedure as defined by the input parameters.
genSeq
has two modes, according to the input.
genSeq(obj,r)
: gives r
random sequences from the
design specified by obj
, along with the parameters stored in obj
.
genSeq(obj)
: gives one random sequences from the
design specified by obj
, along with the parameters stored in obj
.
The sequences are generated by using the Monte-Carlo sampling technique to sample
from the true distribution of the sequences according to the randomization procedure
specified by obj
.
The parameters of the randomization procedure are saved along with the sequences
to ensure reproducibility of the results.
An object inheriting from randSeq, representing the r
randomization sequences generated at random for the specified randomization procedure.
The output consists of the parameters used for the generation of the
randomization sequences (see createParam
) and the matrix M
that stores the randomization sequences in its r
rows.
If r
is missing, one sequence is generated by default.
# generate randomization sequences using Complete Randomization for N = 10 myPar <- crPar(10) genSeq(myPar, 4) genSeq(myPar) # generate randomization sequences using the Random Allocation Rule for N = 10 myPar <- rarPar(10) genSeq(myPar, 4) genSeq(myPar) # generate randomization sequences using the Maximal Procedure with mti = 2 and N = 10 myPar <- mpPar(10, 2) genSeq(myPar, 4) genSeq(myPar)
# generate randomization sequences using Complete Randomization for N = 10 myPar <- crPar(10) genSeq(myPar, 4) genSeq(myPar) # generate randomization sequences using the Random Allocation Rule for N = 10 myPar <- rarPar(10) genSeq(myPar, 4) genSeq(myPar) # generate randomization sequences using the Maximal Procedure with mti = 2 and N = 10 myPar <- mpPar(10, 2) genSeq(myPar, 4) genSeq(myPar)
Computes the noncentrality parameters delta and lambda for the doubly noncentral t-distribution of each randomization sequence.
genNcps_new(randSeq, bias, endp, weight = FALSE)
genNcps_new(randSeq, bias, endp, weight = FALSE)
randSeq |
a list of randSeq(rCrSeq or others) with possible varying N's |
bias |
a list of biases - corresponding to the different randSeq's |
endp |
object of the class endpoint. |
weight |
if set to TRUE the weight will be set to 1, according to the paper |
a list containing the noncentrality parameters delta and lambda of all randomization sequences.
Computes the p values based on the noncentrality parameters delta and lambda for the doubly noncentral t-distribution
get_p_values_new(delta, lambda, N, alpha = 0.05, df = sum(N - 2))
get_p_values_new(delta, lambda, N, alpha = 0.05, df = sum(N - 2))
delta |
The first noncentrality parameter |
lambda |
The second noncentrality parameter |
N |
the amount of patients in the trial |
alpha |
significance level |
df |
degrees of freedom |
a p value
Calculates the guesses of the investigator of a randomization list following the specified guessing strategy.
getCorGuesses(randSeq, guessing)
getCorGuesses(randSeq, guessing)
randSeq |
object of the class randSeq. |
guessing |
object of the class corGuess. |
Matrix of the guesses of the investigator following the specified guessing
strategy. No guess is abbreviated with "nG"
.
myPar <- bsdPar(10, 2) M <- genSeq(myPar, 2) type <- corGuess("CS") getCorGuesses(M, type)
myPar <- bsdPar(10, 2) M <- genSeq(myPar, 2) type <- corGuess("CS") getCorGuesses(M, type)
Generates a character
vector which specifies the used desirability function and
its parameters
getDesFunc(obj) ## S4 method for signature 'derringerLs' getDesFunc(obj) ## S4 method for signature 'derringerRs' getDesFunc(obj) ## S4 method for signature 'derringerTs' getDesFunc(obj)
getDesFunc(obj) ## S4 method for signature 'derringerLs' getDesFunc(obj) ## S4 method for signature 'derringerRs' getDesFunc(obj) ## S4 method for signature 'derringerTs' getDesFunc(obj)
obj |
object of the class |
A character
vector which specifies the used desirability
function and its parameters
Generates a character
vector which specifies the used randomization method
getDesign(obj) ## S4 method for signature 'pbrPar' getDesign(obj) ## S4 method for signature 'rarPar' getDesign(obj) ## S4 method for signature 'rarSeq' getDesign(obj) ## S4 method for signature 'abcdPar' getDesign(obj) ## S4 method for signature 'abcdSeq' getDesign(obj) ## S4 method for signature 'bbcdPar' getDesign(obj) ## S4 method for signature 'bbcdSeq' getDesign(obj) ## S4 method for signature 'ebcPar' getDesign(obj) ## S4 method for signature 'bsdPar' getDesign(obj) ## S4 method for signature 'bsdSeq' getDesign(obj) ## S4 method for signature 'chenPar' getDesign(obj) ## S4 method for signature 'chenSeq' getDesign(obj) ## S4 method for signature 'crPar' getDesign(obj) ## S4 method for signature 'crSeq' getDesign(obj) ## S4 method for signature 'ebcSeq' getDesign(obj) ## S4 method for signature 'gbcdPar' getDesign(obj) ## S4 method for signature 'gbcdSeq' getDesign(obj) ## S4 method for signature 'hadaPar' getDesign(obj) ## S4 method for signature 'hadaSeq' getDesign(obj) ## S4 method for signature 'mpPar' getDesign(obj) ## S4 method for signature 'mpSeq' getDesign(obj) ## S4 method for signature 'pbrSeq' getDesign(obj) ## S4 method for signature 'rRtbdSeq' getDesign(obj) ## S4 method for signature 'rRpbrSeq' getDesign(obj) ## S4 method for signature 'rpbrPar' getDesign(obj) ## S4 method for signature 'tbdPar' getDesign(obj) ## S4 method for signature 'rtbdPar' getDesign(obj) ## S4 method for signature 'tbdSeq' getDesign(obj) ## S4 method for signature 'udPar' getDesign(obj) ## S4 method for signature 'udSeq' getDesign(obj)
getDesign(obj) ## S4 method for signature 'pbrPar' getDesign(obj) ## S4 method for signature 'rarPar' getDesign(obj) ## S4 method for signature 'rarSeq' getDesign(obj) ## S4 method for signature 'abcdPar' getDesign(obj) ## S4 method for signature 'abcdSeq' getDesign(obj) ## S4 method for signature 'bbcdPar' getDesign(obj) ## S4 method for signature 'bbcdSeq' getDesign(obj) ## S4 method for signature 'ebcPar' getDesign(obj) ## S4 method for signature 'bsdPar' getDesign(obj) ## S4 method for signature 'bsdSeq' getDesign(obj) ## S4 method for signature 'chenPar' getDesign(obj) ## S4 method for signature 'chenSeq' getDesign(obj) ## S4 method for signature 'crPar' getDesign(obj) ## S4 method for signature 'crSeq' getDesign(obj) ## S4 method for signature 'ebcSeq' getDesign(obj) ## S4 method for signature 'gbcdPar' getDesign(obj) ## S4 method for signature 'gbcdSeq' getDesign(obj) ## S4 method for signature 'hadaPar' getDesign(obj) ## S4 method for signature 'hadaSeq' getDesign(obj) ## S4 method for signature 'mpPar' getDesign(obj) ## S4 method for signature 'mpSeq' getDesign(obj) ## S4 method for signature 'pbrSeq' getDesign(obj) ## S4 method for signature 'rRtbdSeq' getDesign(obj) ## S4 method for signature 'rRpbrSeq' getDesign(obj) ## S4 method for signature 'rpbrPar' getDesign(obj) ## S4 method for signature 'tbdPar' getDesign(obj) ## S4 method for signature 'rtbdPar' getDesign(obj) ## S4 method for signature 'tbdSeq' getDesign(obj) ## S4 method for signature 'udPar' getDesign(obj) ## S4 method for signature 'udSeq' getDesign(obj)
obj |
object of the class |
the name of the randomization procedure used
Applying desirability function on issues of individual randomization sequences.
getDesScores(assess, ..., weights) ## S4 method for signature 'assessment,missing' getDesScores(assess, ..., weights) ## S4 method for signature 'assessment,numeric' getDesScores(assess, ..., weights)
getDesScores(assess, ..., weights) ## S4 method for signature 'assessment,missing' getDesScores(assess, ..., weights) ## S4 method for signature 'assessment,numeric' getDesScores(assess, ..., weights)
assess |
object of class |
... |
at least one object of class |
weights |
weights for computing the geometric mean of several desirability scores. If missing, the issues are automatically equally weighted. |
Randomization sequences behave differently with respect to issues
like selection bias, chronological bias, or loss in power estimation.
The getDesScores
function evaluates the behavior of randomization
sequences with respect to these issues. The difference to the assess
function is that it scales them to \[0,1\] and makes them easier interpretable.
The first argument should be a result of the assess
function.
The second argument should be any number of derFunc
objects
that represent the desirability functions. The last argument weights
may be provided if the desirability functions should be weighted differently.
S4
object of class desirability
summarizing the desirability of the
randomization procedure.
Representation of randomization procedures: randPar
Generation of randomization sequences: genSeq
issues
for the desirability of randomization sequences
Other desirability topics:
derFunc
,
evaluate()
,
plotDes()
,
plotEv()
,
probUnDes()
# compute the desire-function for the full set of Random Allocation Rule for N = 4 sequences <- getAllSeq(rarPar(4)) issue1 <- corGuess("CS") issue2 <- chronBias("linT", 0.25, "exact") endp <- normEndp(mu = c(0,0), sigma = c(1,1)) A <- assess(sequences, issue1, issue2, endp = endp) d1 <- derFunc(0.5, 0.75, 1) d2 <- derFunc(0.05, 0.1, 1) D1 <- getDesScores(A, d1, d2) summary(D1) D2 <- getDesScores(A, d1, d2, weights = c(3/4, 1/4)) summary(D2)
# compute the desire-function for the full set of Random Allocation Rule for N = 4 sequences <- getAllSeq(rarPar(4)) issue1 <- corGuess("CS") issue2 <- chronBias("linT", 0.25, "exact") endp <- normEndp(mu = c(0,0), sigma = c(1,1)) A <- assess(sequences, issue1, issue2, endp = endp) d1 <- derFunc(0.5, 0.75, 1) d2 <- derFunc(0.05, 0.1, 1) D1 <- getDesScores(A, d1, d2) summary(D1) D2 <- getDesScores(A, d1, d2, weights = c(3/4, 1/4)) summary(D2)
Generates a matrix of the distribution parameters of the included patients in the clinical trial.
getDistributionPars(randSeq, issue, endp) ## S4 method for signature 'randSeq,missing,survEndp' getDistributionPars(randSeq, endp) ## S4 method for signature 'randSeq,chronBias,survEndp' getDistributionPars(randSeq, issue, endp) ## S4 method for signature 'randSeq,selBias,survEndp' getDistributionPars(randSeq, issue, endp) ## S4 method for signature 'randSeq,combinedBias,survEndp' getDistributionPars(randSeq, issue, endp) ## S4 method for signature 'randSeq,combinedBiasStepTrend,survEndp' getDistributionPars(randSeq, issue, endp)
getDistributionPars(randSeq, issue, endp) ## S4 method for signature 'randSeq,missing,survEndp' getDistributionPars(randSeq, endp) ## S4 method for signature 'randSeq,chronBias,survEndp' getDistributionPars(randSeq, issue, endp) ## S4 method for signature 'randSeq,selBias,survEndp' getDistributionPars(randSeq, issue, endp) ## S4 method for signature 'randSeq,combinedBias,survEndp' getDistributionPars(randSeq, issue, endp) ## S4 method for signature 'randSeq,combinedBiasStepTrend,survEndp' getDistributionPars(randSeq, issue, endp)
randSeq |
object of the class randSeq. |
issue |
object of the class issue (optional). |
endp |
object of the class endpoint. |
a matrix of the distribution parameters of the included patients in the clinical trial.
# return the shape and scale parameters of a Weibull distribution endp <- survEndp(shape = c(1,1), scale = c(0.5,1), cenTime = 10, cenRate = 0.01) biasSB <- selBias("CS", log(2), "exact") randSeq <- genSeq(rpbrPar(rb = 2, N = 12)) getDistributionPars(randSeq,biasSB,endp)
# return the shape and scale parameters of a Weibull distribution endp <- survEndp(shape = c(1,1), scale = c(0.5,1), cenTime = 10, cenRate = 0.01) biasSB <- selBias("CS", log(2), "exact") randSeq <- genSeq(rpbrPar(rb = 2, N = 12)) getDistributionPars(randSeq,biasSB,endp)
Generates a matrix of the expectations of the included patients in the clinical trial.
getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,missing,survEndp' getExpectation(randSeq, endp) ## S4 method for signature 'randSeq,missing,expEndp' getExpectation(randSeq, endp) ## S4 method for signature 'randSeq,missing,normEndp' getExpectation(randSeq, endp) ## S4 method for signature 'randSeq,power,normEndp' getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,chronBias,normEndp' getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,chronBias,expEndp' getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,chronBias,survEndp' getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,chronBias,missing' getExpectation(randSeq, issue) ## S4 method for signature 'randSeq,selBias,normEndp' getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,selBias,expEndp' getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,selBias,survEndp' getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,selBias,missing' getExpectation(randSeq, issue) ## S4 method for signature 'randSeq,combinedBias,normEndp' getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,combinedBias,expEndp' getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,combinedBias,survEndp' getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,combinedBiasStepTrend,normEndp' getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,combinedBiasStepTrend,expEndp' getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,combinedBiasStepTrend,survEndp' getExpectation(randSeq, issue, endp)
getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,missing,survEndp' getExpectation(randSeq, endp) ## S4 method for signature 'randSeq,missing,expEndp' getExpectation(randSeq, endp) ## S4 method for signature 'randSeq,missing,normEndp' getExpectation(randSeq, endp) ## S4 method for signature 'randSeq,power,normEndp' getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,chronBias,normEndp' getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,chronBias,expEndp' getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,chronBias,survEndp' getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,chronBias,missing' getExpectation(randSeq, issue) ## S4 method for signature 'randSeq,selBias,normEndp' getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,selBias,expEndp' getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,selBias,survEndp' getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,selBias,missing' getExpectation(randSeq, issue) ## S4 method for signature 'randSeq,combinedBias,normEndp' getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,combinedBias,expEndp' getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,combinedBias,survEndp' getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,combinedBiasStepTrend,normEndp' getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,combinedBiasStepTrend,expEndp' getExpectation(randSeq, issue, endp) ## S4 method for signature 'randSeq,combinedBiasStepTrend,survEndp' getExpectation(randSeq, issue, endp)
randSeq |
object of the class randSeq. |
issue |
object of the class issue (optional). |
endp |
object of the class endpoint (optional). |
It is assumed that the expectations of the included patients in a clinical trial can be influenced in three different ways:
The strength of selection bias and the guessing strategy
of the investigator (see selBias
).
The strength of a linear time trend, which is described by an object
of the class chronBias
.
The expectations of the investigated treatment groups can be different
(see e.g. normEndp
).
A matrix of the expectations of the included patients in the clinical trial.
# get Expectation for a normal endpoint myPar <- bsdPar(10, 2) M <- genSeq(myPar, 2) cs <- selBias("CS", 2, "sim") endp <- normEndp(mu = c(2, 2), sigma = c(1, 1)) getExpectation(M, cs, endp) # get Expectation for an exponential endpoint cs <- selBias("CS", 0.1 , "sim") endp <- expEndp(lambda = c(0.5, 1), cenTime = 10, cenRate = 0.01) getExpectation(M, cs, endp)
# get Expectation for a normal endpoint myPar <- bsdPar(10, 2) M <- genSeq(myPar, 2) cs <- selBias("CS", 2, "sim") endp <- normEndp(mu = c(2, 2), sigma = c(1, 1)) getExpectation(M, cs, endp) # get Expectation for an exponential endpoint cs <- selBias("CS", 0.1 , "sim") endp <- expEndp(lambda = c(0.5, 1), cenTime = 10, cenRate = 0.01) getExpectation(M, cs, endp)
Calculate theoretical probability for observed randomization sequences
getProb(obj) ## S4 method for signature 'rarSeq' getProb(obj) ## S4 method for signature 'abcdSeq' getProb(obj) ## S4 method for signature 'bbcdSeq' getProb(obj) ## S4 method for signature 'bsdSeq' getProb(obj) ## S4 method for signature 'chenSeq' getProb(obj) ## S4 method for signature 'crSeq' getProb(obj) ## S4 method for signature 'ebcSeq' getProb(obj) ## S4 method for signature 'gbcdSeq' getProb(obj) ## S4 method for signature 'hadaSeq' getProb(obj) ## S4 method for signature 'mpSeq' getProb(obj) ## S4 method for signature 'pbrSeq' getProb(obj) ## S4 method for signature 'tbdSeq' getProb(obj) ## S4 method for signature 'udSeq' getProb(obj)
getProb(obj) ## S4 method for signature 'rarSeq' getProb(obj) ## S4 method for signature 'abcdSeq' getProb(obj) ## S4 method for signature 'bbcdSeq' getProb(obj) ## S4 method for signature 'bsdSeq' getProb(obj) ## S4 method for signature 'chenSeq' getProb(obj) ## S4 method for signature 'crSeq' getProb(obj) ## S4 method for signature 'ebcSeq' getProb(obj) ## S4 method for signature 'gbcdSeq' getProb(obj) ## S4 method for signature 'hadaSeq' getProb(obj) ## S4 method for signature 'mpSeq' getProb(obj) ## S4 method for signature 'pbrSeq' getProb(obj) ## S4 method for signature 'tbdSeq' getProb(obj) ## S4 method for signature 'udSeq' getProb(obj)
obj |
object of a class inheriting from randSeq. Formal representation of a randomization sequences together with the parameters that belong to the procedure that generated the sequences. |
a matrix with theoretical probabilities for observed randomization sequences
myPar <- bsdPar(10, 2) M <- genSeq(myPar, 2) getProb(M) # all Sequences par <- pbrPar(bc=c(2,2)) refSet <- getAllSeq(myPar) probs <- getProb(refSet) # sequences with probabilities cbind(probs, refSet$M)
myPar <- bsdPar(10, 2) M <- genSeq(myPar, 2) getProb(M) # all Sequences par <- pbrPar(bc=c(2,2)) refSet <- getAllSeq(myPar) probs <- getProb(refSet) # sequences with probabilities cbind(probs, refSet$M)
Get the randomization list coded in its groups.
getRandList(obj)
getRandList(obj)
obj |
object specifying the randomization procedure, see |
A matrix with all randomization sequences of a S4
object
myPar <- bsdPar(10, 2) M <- genSeq(myPar, 2) getRandList(M)
myPar <- bsdPar(10, 2) M <- genSeq(myPar, 2) getRandList(M)
Calculates the Type I error for different randomization sequences from a randomization procedure for a group sequential design
GSD_allocation( n, reps, sfu, K, rp, seed = 42, ui = "No", rb = 4, mti = 3, p = 2/3 )
GSD_allocation( n, reps, sfu, K, rp, seed = 42, ui = "No", rb = 4, mti = 3, p = 2/3 )
n |
total sample size |
reps |
number of simulations to be conducted |
sfu |
Group sequential design used (currently available: |
K |
number of stages |
rp |
the randomization procedure used (currently available: |
seed |
Randomization seed |
ui |
for Lan & DeMets design. Update critical values after each stage according to allocation ratio observed if set to |
rb |
Block size for randomization procedure PBR. |
mti |
Maximum tolerated imbalance for randomization procedure BSD and MP. |
p |
Probability p in favor of the treatment with fewer allocations for EBC and CHEN. |
A list consisting of a vector of Type I errors for each randomization sequence generated from the randomization procedure and a S4 object of the class of the randomization procedure.
#Simulate a group sequential design according to O'Brien and Fleming's design with 24 patients, #10 simulation runs,3 Stages using Random Allocation Rule as a randomization procedure. GSD_allocation(n=24, reps=10, sfu="OF", K=3, rp="RAR") #Simulate a group sequential design according to Lan and deMets design with a Pocock #like alpha spending function with 18 patients, 10 simulation runs, #3 Stages using Permuted Block Randomization with block size 4 #as a randomization procedure without updating the critical values after each stage. library(gsDesign) GSD_allocation(n=18, reps=10, sfu=sfLDPocock, K=3, rp="PBR", ui="no", rb=4)
#Simulate a group sequential design according to O'Brien and Fleming's design with 24 patients, #10 simulation runs,3 Stages using Random Allocation Rule as a randomization procedure. GSD_allocation(n=24, reps=10, sfu="OF", K=3, rp="RAR") #Simulate a group sequential design according to Lan and deMets design with a Pocock #like alpha spending function with 18 patients, 10 simulation runs, #3 Stages using Permuted Block Randomization with block size 4 #as a randomization procedure without updating the critical values after each stage. library(gsDesign) GSD_allocation(n=18, reps=10, sfu=sfLDPocock, K=3, rp="PBR", ui="no", rb=4)
Calculates the Type I error for a randomization sequence in a group sequential design
GSD_allocation_seq(sfu, K, seq, ui = "No")
GSD_allocation_seq(sfu, K, seq, ui = "No")
sfu |
Group sequential design used (currently available: |
K |
number of stages |
seq |
List of consecutive treatment allocations. 1 for first treatment A, 2 for second treatment. |
ui |
Only for Lan & DeMets design. Update critical values after each stage according to allocation ratio observed if set to |
A list of type I error probabilities for each stage.
#Simulate a group sequential design according to Pocock's design with 24 patients #and the following consecutive treatment allocation: #A, A, B, A, A, B, A, B, A, B, A, B, A, B, A, B, B, B, A, B, B, A, B, B GSD_allocation_seq(sfu ="Pocock", K=3, seq = c(1,1,0,1,1,0,1,1,1,0,1,0,1,0,1,0,0,0,1,0,0,1,0,0)) #Simulate a group sequential design according to Lan and DeMets with O'Brien & Fleming #like alpha spending with 24 patients and the following consecutive treatment allocation: #A, A, B, A, A, B, A, B, A, B, A, B, A, B, A, B, B, B, A, B, B, A, B, B library(gsDesign) GSD_allocation_seq(sfu =sfLDOF, K=3, seq = c(1,1,0,1,1,0,1,1,1,0,1,0,1,0,1,0,0,0,1,0,0,1,0,0))
#Simulate a group sequential design according to Pocock's design with 24 patients #and the following consecutive treatment allocation: #A, A, B, A, A, B, A, B, A, B, A, B, A, B, A, B, B, B, A, B, B, A, B, B GSD_allocation_seq(sfu ="Pocock", K=3, seq = c(1,1,0,1,1,0,1,1,1,0,1,0,1,0,1,0,0,0,1,0,0,1,0,0)) #Simulate a group sequential design according to Lan and DeMets with O'Brien & Fleming #like alpha spending with 24 patients and the following consecutive treatment allocation: #A, A, B, A, A, B, A, B, A, B, A, B, A, B, A, B, B, B, A, B, B, A, B, B library(gsDesign) GSD_allocation_seq(sfu =sfLDOF, K=3, seq = c(1,1,0,1,1,0,1,1,1,0,1,0,1,0,1,0,0,0,1,0,0,1,0,0))
Represents the randomization procedure Hadamard Randomization.
hadaPar(N, groups = LETTERS[1:2])
hadaPar(N, groups = LETTERS[1:2])
N |
integer for the total sample size of the trial. |
groups |
character vector of labels for the different treatments. |
Hadamard randomization has been proposed by R.A. Bailey. The key idea is to
use the columns of a special Hadamard Matrix as a randomization scheme. The
implemented algorithm uses the Hadamard Matrix with N=12
columns
proposed in the paper, see references.
S4
object of the class hadaPar
.
getProb
and getAllSeq
are currently only supported for hadaPar
with total sample size N=12
.
R.A. Bailey and P.R. Nelson (2003) Hadamard Randomization: A valid restriction of random permuted blocks. Biometrical Journal, 45, 554-60.
Other randomization procedures:
abcdPar
,
bbcdPar
,
bsdPar
,
chenPar
,
crPar
,
createParam()
,
ebcPar
,
gbcdPar
,
mpPar
,
pbrPar
,
rarPar
,
rpbrPar
,
rtbdPar
,
tbdPar
,
udPar
Represents the imbalance of the treatment assignments of patients in a clinical trial.
imbal(type)
imbal(type)
type |
character string, should be one of |
Balance of the treatment assignment of patients can
be an issue in the design of a clinical trial. The imbal
function is
a constructor function for an S4 object of class imbal
representing
the issue of imbalance of a clinical trial. The parameter type
can
take the following values:
The type
"imb"
the final imbalance, i.e. difference in group sizes at the end of a trial
"absImb"
the absolute value of the final imbalance
"loss"
the loss in power estimation, i.e. imb^2/N
"maxImb"
the maximal attained imbalance during the trial
S4
object of class imbal
, a formal representation of the issue of
imbalance in a clinical trial.
A.C. Atkinson (2014) Selecting a biased coin design. Statistical Science, 29, Vol. 1, 144-163.
Other issues:
chronBias
,
combineBias()
,
corGuess
,
issue
,
selBias
,
setPower()
Summarizes the criteria for the assessment of randomization procedures.
Randomization in clinical trials is supposed to
control certain properties in clinical trials. In the randomizeR package,
these properties are called issues
.
It is crucial to decide which of the issues is relevant in the present
clinical trial, because a randomization procedure that manages well one issue
might behave very badly for another. The issues include
Selection bias
can occur if future treatment allocations are predictable due to
restricted randomization and unmasking of past treatment assignments.
The influence of selection bias on the test decision is represented by
the selBias
class. The measure for the predictability of
a randomization procedure is implemented in the corGuess
class
representing the expected number of correct guesses.
Chronological bias
can occur if a time trend is present in the data. Time trends occur
due to learning curves, relaxed inclusion/ exclusion criteria or
new co-medication.
Chronological bias is represented by the chronBias
class.
Additive combination of chronological and selection bias
may occur if a time trend and selection bias are present in the data.
The combined bias is represented by the combineBias
class.
Balance
is important in order to ensure proper power estimation properties of
the treatments.
However, a high degree of balance favors selection bias. Depending on the
clinical context, a randomization procedure should be chosen that admits
a suitable imbalance.
Imbalance bias is represented by the imbal
class. The power
loss due to imbalance can be assessed directly via the setPower
class
Representation of randomization procedures: randPar
Generation of randomization sequences: genSeq
Assessment of randomization sequences: assess
Comparison of randomization sequences: compare
Other issues:
chronBias
,
combineBias()
,
corGuess
,
imbal
,
selBias
,
setPower()
Function returning the number of trial arms slot of an S4 object
K(obj)
K(obj)
obj |
object of class randPar |
The number of trial arms
Method returning the rate parameter of an expEndp S4 object
lambda(obj)
lambda(obj)
obj |
object of class expEndp |
Function returning the method of an S4 object
method(obj)
method(obj)
obj |
object inheriting from randPar |
The method of an S4
object
Represents the Maximal Procedure.
mpPar(N, mti, ratio = c(1, 1), groups = LETTERS[1:2])
mpPar(N, mti, ratio = c(1, 1), groups = LETTERS[1:2])
N |
integer for the total sample size of the trial. |
mti |
maximum tolerated imbalance in patient numbers during the trial. |
ratio |
vector of length |
groups |
character vector of labels for the different treatments. |
Fix the total sample size N
and the mti
. Afterwards, the patients
are assigned to each treatment arm according to the ratio
.
All randomization sequences are equiprobable.
S4
object of the class mpPar
.
V.W. Berger, A. Ivanova and M.D. Knoll (2003) Minimizing predictability while retaining balance through the use of less restrictive randomization procedures. Statistics in Medicine, 19, 3017-28.
Other randomization procedures:
abcdPar
,
bbcdPar
,
bsdPar
,
chenPar
,
crPar
,
createParam()
,
ebcPar
,
gbcdPar
,
hadaPar
,
pbrPar
,
rarPar
,
rpbrPar
,
rtbdPar
,
tbdPar
,
udPar
Function returning the MTI slot of an S4 object
mti(obj)
mti(obj)
obj |
object of class bsdPar or mpPar |
Access the expectation value slot of a normEndp S4 object
mu(obj)
mu(obj)
obj |
object of class normEndp |
Function returning the sample size slot of an S4 object
N(obj)
N(obj)
obj |
object inheriting from randPar |
the sample size slot of an S4
object
Represents normally distributed endpoints in clinical trials.
normEndp(mu, sigma)
normEndp(mu, sigma)
mu |
vector of the expected responses of the treatment groups, should have
length |
sigma |
vector of the standard deviations in each treatment group,
should have length |
The normEnd
function is a constructor function
for an S4 object of the class normEnd
representing
a normally distributed endpoint in a clinical trial.
In conjunction with the assess function, normal endpoints
admit the calculation of the exact type-I-error probability and power.
A S4
object that represents a normally distributed endpoint in a clinical trial
Compute exact or simulated type-I-error: assess
.
Other endpoint types:
expEndp
,
survEndp
# set the parameters of two normally distributed endpoints endp <- normEndp(mu = c(1, 2), sigma = c(1, 1))
# set the parameters of two normally distributed endpoints endp <- normEndp(mu = c(1, 2), sigma = c(1, 1))
randomizeR
packageThis list of parameters yields a comprehensive overview of the parameters
used in the randomizeR
package.
a |
nonnegative parameter which controls the degree of randomness:
For decreasing |
accrualTime |
duration of the accrual period in a survival study. |
add |
integer representing the number of balls that are added to the urn in each step. |
alpha |
the significance level of the test in each simulation. |
bc |
vector which contains the lengths |
b |
numeric vector of length at most 2 specifying the weight(s) for the punishment of deviations from the target value. |
cenRate |
exponential censoring rate in a survival study. |
cenTime |
total duration of a survival study (maximum length of followup). |
d |
effect size. |
df |
degrees of freedom (i.a. |
eta |
numeric specifying the magnitude of selection bias. |
file |
A connection, or a character string naming the file to write to. |
filledBlock |
|
FTI |
final tolerated imbalance. This is the difference in number of patients of groups A and B that is permitted at the end of a trial. Usually this is set to zero. |
groups |
character vector of labels for the different treatments. |
ini |
integer representing the initial urn composition. |
k |
length of the block to be permuted. |
K |
number of treatment groups (e.g. K=2 if we compare one experimental against one control treatment). |
lb |
lower bound for the starting value of the poisson distribution. |
lambda |
vector of the exponential rate parameters in each treatment group. |
method |
method that is used to generate the (random) allocation
sequence. It can take values |
mti |
maximum tolerated imbalance in patient numbers during the trial. |
mu |
vector of the expected responses of the treatment groups, should have
length |
N |
integer for the total sample size of the trial. |
name |
name of a variable. |
obj |
object specifying the randomization procedure, see |
object |
any R object. |
p |
success probability of the biased coin (e.g. in Efron's Biased Coin Design). |
pr |
vector with patient responses, i.e. each patients resulting value after the treatment. |
q |
"cut-off" value in |
r |
numeric indicating the number of random sequences to be generated at random, or missing. |
ratio |
vector of length |
rb |
block lengths of the blocks that can be selected equiprobable at random. |
rho |
nonnegative parameter which my be adjusted according to how strongly it is
desired to balance the experiment. If |
rsob |
randomization sequence (of one block). |
rs |
randomization sequence (of all blocks). |
S |
matrix for the computation of the probabilities in the maximal procedure. |
saltus |
integer or |
seed |
a single value, interpreted as an integer, that specifies the seed for the random number generation. |
sigma |
vector of the standard deviations in each treatment group,
should have length |
SLs |
numeric vector of length at most 2 specifying the lower and/or upper specified border. |
theta |
factor of the time trend for further details see |
type |
character vector indicating which biasing strategy the
experimenter is using (selection bias) and which other bias is present in the
clinical trial (e.g. time trend). All biases included in the vector are
combined (i.e. added up) to form the total bias. Possible values are
|
TV |
numeric specifying the optimal desired value called the target value. |
ub |
upper bound for the last value of the poisson distribution. |
varEq |
|
x |
a variable |
allocRatio |
numerical vector that represents the allocation ratio for the different strata in a clinical trial |
strata |
numeric specifying the number of strata in a clinical trial |
maxcombo |
logical specifying if the maxcombo test is used |
weights |
numeric specifying the weights used for the test. Unless specified an unweighted test is conducted. |
Represents the randomization procedure Permuted Block Randomization.
pbrPar(bc, K = 2, ratio = rep(1, K), groups = LETTERS[1:K])
pbrPar(bc, K = 2, ratio = rep(1, K), groups = LETTERS[1:K])
bc |
vector which contains the lengths |
K |
number of treatment groups (e.g. K=2 if we compare one experimental against one control treatment). |
ratio |
vector of length |
groups |
character vector of labels for the different treatments. |
Fix the block constellation bc
, the number of treatment groups K
,
and the vector of the ratio
. Afterwards,
in each block the patients are assigned according to the ratio to the
corresponding treatment groups. All generated randomization sequences
are equiprobable.
S4
object of the class pbrPar
.
W. F. Rosenberger and J. M. Lachin (2002) Randomization in Clinical Trials. Wiley.
Other randomization procedures:
abcdPar
,
bbcdPar
,
bsdPar
,
chenPar
,
crPar
,
createParam()
,
ebcPar
,
gbcdPar
,
hadaPar
,
mpPar
,
rarPar
,
rpbrPar
,
rtbdPar
,
tbdPar
,
udPar
Generic plotting of comparison objects
plot(x, y, ...) ## S4 method for signature 'comparison,character' plot(x, y) ## S4 method for signature 'comparison,missing' plot(x, y)
plot(x, y, ...) ## S4 method for signature 'comparison,character' plot(x, y) ## S4 method for signature 'comparison,missing' plot(x, y)
x |
object of class |
y |
character |
... |
|
Creates a box- or violinplot of an object x
of the class comparison
.
A plot created with the additional package ggplot2
.
compare
for creating S4
objects of the class comparison
# compare Random Allocation Rule and Big Stick for N = 4 with respect to # correct guesses RAR <- getAllSeq(rarPar(4)) BSD <- getAllSeq(bsdPar(4, mti = 2)) corGuess <- corGuess("CS") comp <- compare(corGuess, RAR, BSD) plot(comp)
# compare Random Allocation Rule and Big Stick for N = 4 with respect to # correct guesses RAR <- getAllSeq(rarPar(4)) BSD <- getAllSeq(bsdPar(4, mti = 2)) corGuess <- corGuess("CS") comp <- compare(corGuess, RAR, BSD) plot(comp)
Plot of an desScore
object.
plotDes(desScore, labels, colAv = "red", quantiles = FALSE)
plotDes(desScore, labels, colAv = "red", quantiles = FALSE)
desScore |
object of type |
labels |
labels used in the plot. Can be |
colAv |
color of the line representing the average of the desirability scores in the plot. |
quantiles |
|
a plot of an desScore
object
Other desirability topics:
derFunc
,
evaluate()
,
getDesScores()
,
plotEv()
,
probUnDes()
# compute the desirability scores of the full set of PBR(4) sequences <- getAllSeq(rarPar(4)) issue1 <- corGuess("CS") issue2 <- chronBias("linT", 1/4, "exact") endp <- normEndp(mu = c(0,0), sigma = c(1,1)) A <- assess(sequences, issue1, issue2, endp = endp) d1 <- derFunc(0.5, 0.75, 1) d2 <- derFunc(0.05, 0.1, 1) D <- getDesScores(A, d1, d2) summary(D) plotDes(D) plotDes(D, quantiles = TRUE)
# compute the desirability scores of the full set of PBR(4) sequences <- getAllSeq(rarPar(4)) issue1 <- corGuess("CS") issue2 <- chronBias("linT", 1/4, "exact") endp <- normEndp(mu = c(0,0), sigma = c(1,1)) A <- assess(sequences, issue1, issue2, endp = endp) d1 <- derFunc(0.5, 0.75, 1) d2 <- derFunc(0.05, 0.1, 1) D <- getDesScores(A, d1, d2) summary(D) plotDes(D) plotDes(D, quantiles = TRUE)
Plot of an evaluation
object.
plotEv(evaluation, labels, cols)
plotEv(evaluation, labels, cols)
evaluation |
object of type |
labels |
labels used in the plot. Can be |
cols |
colors of the lines representing the desirability scores in the plot. Can be |
A plot of an evaluation
object
Other desirability topics:
derFunc
,
evaluate()
,
getDesScores()
,
plotDes()
,
probUnDes()
# compare Random Allocation Rule to Big Stick Design with respect to different issues # and their corresponding desirability functions issue1 <- corGuess("CS") issue2 <- chronBias(type = "linT", theta = 1/4, method = "exact") RAR <- getAllSeq(rarPar(4)) BSD <- getAllSeq(bsdPar(4, mti = 2)) A1 <- assess(RAR, issue1, issue2, endp = normEndp(c(0,0), c(1,1))) A2 <- assess(BSD, issue1, issue2, endp = normEndp(c(0,0), c(1,1))) d1 <- derFunc(TV = 0.5, 0.75, 2) d2 <- derFunc(0.05, c(0, 0.1), c(1, 1)) DesScore <- getDesScores(A1, d1, d2, weights = c(5/6, 1/6)) DesScore2 <- getDesScores(A2, d1, d2, weights = c(5/6, 1/6)) E <- evaluate(DesScore, DesScore2) plotEv(E)
# compare Random Allocation Rule to Big Stick Design with respect to different issues # and their corresponding desirability functions issue1 <- corGuess("CS") issue2 <- chronBias(type = "linT", theta = 1/4, method = "exact") RAR <- getAllSeq(rarPar(4)) BSD <- getAllSeq(bsdPar(4, mti = 2)) A1 <- assess(RAR, issue1, issue2, endp = normEndp(c(0,0), c(1,1))) A2 <- assess(BSD, issue1, issue2, endp = normEndp(c(0,0), c(1,1))) d1 <- derFunc(TV = 0.5, 0.75, 2) d2 <- derFunc(0.05, c(0, 0.1), c(1, 1)) DesScore <- getDesScores(A1, d1, d2, weights = c(5/6, 1/6)) DesScore2 <- getDesScores(A2, d1, d2, weights = c(5/6, 1/6)) E <- evaluate(DesScore, DesScore2) plotEv(E)
Plot all randomization sequences of a randSeq object
plotSeq(sequences, plotAllSeq = FALSE, emph = NA, rs = NA)
plotSeq(sequences, plotAllSeq = FALSE, emph = NA, rs = NA)
sequences |
object of type randSeq |
plotAllSeq |
logical. If |
emph |
integer indicating which sequence should be highlighted in blue. |
rs |
vector of a randomization sequence that should be highlighted. |
A plot of all randomization sequences of a randSeq
object.
Computing the probability of having desirability scores of zero for each desirability function applied to an issue.
probUnDes(desScore) ## S4 method for signature 'desScores' probUnDes(desScore)
probUnDes(desScore) ## S4 method for signature 'desScores' probUnDes(desScore)
desScore |
an object of the class |
The function probUnDes
expects an object that results from the getDesScores
function. For each issue it computes the probability that it achieves an undesirable score,
i.e. a desirability score of 0. In doing so, it weights the zero desirability scores
with the probability that the sequence occurs.
S4
object of class probUnDesirable
computing the probability of getting
undesirable scores, i.e. desirability scores of 0.
Representation of randomization procedures: randPar
Generation of randomization sequences: genSeq
issues
for the desirability of randomization sequences
Other desirability topics:
derFunc
,
evaluate()
,
getDesScores()
,
plotDes()
,
plotEv()
# compare Random Allocation Rule to Big Stick Design with respect to different issues # and their corresponding desirability functions RAR <- getAllSeq(rarPar(4)) issue1 <- corGuess("CS") issue2 <- corGuess("DS") A1 <- assess(RAR, issue1, issue2) d1 <- derFunc(TV = 0.1, 0.7, 2) d2 <- derFunc(0.5, c(0.3, 0.8), c(1, 1)) DesScore <- getDesScores(A1, d1, d2, weights = c(5/6, 1/6)) probUnDes(DesScore)
# compare Random Allocation Rule to Big Stick Design with respect to different issues # and their corresponding desirability functions RAR <- getAllSeq(rarPar(4)) issue1 <- corGuess("CS") issue2 <- corGuess("DS") A1 <- assess(RAR, issue1, issue2) d1 <- derFunc(TV = 0.1, 0.7, 2) d2 <- derFunc(0.5, c(0.3, 0.8), c(1, 1)) DesScore <- getDesScores(A1, d1, d2, weights = c(5/6, 1/6)) probUnDes(DesScore)
Function returning the block slot of an S4 object
randBlocks(obj)
randBlocks(obj)
obj |
object of class pbrPar |
a vector with the lengths of each random block of a pbrPar
object
Randomization procedures in randomizeR are represented by objects that inherit
from randPar
. The representation can then be used in order to
generate randomization sequences. In order generate a representation of a
randomization procedure, call createParam
or one of the following
functions.
Complete Randomization (crPar
)
Random Allocation Rule (rarPar
)
Permuted Block Randomization (pbrPar
)
Permuted Block Randomization with random block length (rpbrPar
)
Truncated Binomial Design (tbdPar
)
Truncated Binomial Design with random block length (rtbdPar
)
Efron's Biased Coin Design (ebcPar
)
Big Stick Design (bsdPar
)
Maximal Procedure (mpPar
)
Wei's Urn Design (udPar
)
Chen's Design (chenPar
)
Generalized Biased Coin Design (gbcdPar
)
Accelerated Biased Coin Design (abcdPar
)
Bayesian Biased Coin Design (bbcdPar
)
Hadamard Randomization (hadaPar
)
Generate randomization sequences genSeq
.
Calculate the the complete set of randomization sequences of a randomization
procedure.
getAllSeq
.
This set of classes provides functionality of storing randomization sequences of different randomization procedures along with the parameters representing the design.
N
total number of patients included in the trial
M
matrix containing randomization sequences of length N
in its
rows.
K
number of treatment groups
groups
character string of length K defining the names of the treatment groups
ratio
ratio of patients between the different groups
Represents the randomization procedure Random Allocation Rule.
rarPar(N, K = 2, ratio = rep(1, K), groups = LETTERS[1:K])
rarPar(N, K = 2, ratio = rep(1, K), groups = LETTERS[1:K])
N |
integer for the total sample size of the trial. |
K |
number of treatment groups (e.g. K=2 if we compare one experimental against one control treatment). |
ratio |
vector of length |
groups |
character vector of labels for the different treatments. |
Fix a total sample size N
the number of treatment groups K
,
and the vector of the ratio
. Afterwards, all patients are assigned
according to the ratio to the corresponding treatment groups.
All randomization sequences are equiprobable.
S4
object of the class rarPar
.
W. F. Rosenberger and J. M. Lachin (2002) Randomization in Clinical Trials. Wiley.
Other randomization procedures:
abcdPar
,
bbcdPar
,
bsdPar
,
chenPar
,
crPar
,
createParam()
,
ebcPar
,
gbcdPar
,
hadaPar
,
mpPar
,
pbrPar
,
rpbrPar
,
rtbdPar
,
tbdPar
,
udPar
Function returning the allocation ratio slot of an S4 object
ratio(obj)
ratio(obj)
obj |
object of class randPar |
A vector containng the allocation ratio of an S4
object
Function returning the adjusting parameter rho slot of an S4 object
rho(obj)
rho(obj)
obj |
object of class randPar |
the value of the rho parameter of an S4
object
Represents the randomization procedure Randomized Permuted Block Randomization.
rpbrPar( N, rb, K = 2, ratio = rep(1, K), groups = LETTERS[1:K], filledBlock = FALSE )
rpbrPar( N, rb, K = 2, ratio = rep(1, K), groups = LETTERS[1:K], filledBlock = FALSE )
N |
integer for the total sample size of the trial. |
rb |
block lengths of the blocks that can be selected equiprobable at random. |
K |
number of treatment groups (e.g. K=2 if we compare one experimental against one control treatment). |
ratio |
vector of length |
groups |
character vector of labels for the different treatments. |
filledBlock |
|
Fix the possible random block lengths rb
, the number of treatment groups K
,
the sample size N
and the vector of the ratio
. Afterwards, one block length is
randomly selected of the random block lengths. The patients are assigned
according to the ratio to the corresponding treatment groups. This procedure is repeated
until N
patients are assigned. Within each block all possible
randomization sequences are equiprobable.
S4
object of the class rpbrPar
.
W. F. Rosenberger and J. M. Lachin (2002) Randomization in Clinical Trials. Wiley.
Other randomization procedures:
abcdPar
,
bbcdPar
,
bsdPar
,
chenPar
,
crPar
,
createParam()
,
ebcPar
,
gbcdPar
,
hadaPar
,
mpPar
,
pbrPar
,
rarPar
,
rtbdPar
,
tbdPar
,
udPar
Represents the randomization procedure Randomized Truncated Binomial Design.
rtbdPar(N, rb = N, groups = LETTERS[1:2], filledBlock = FALSE)
rtbdPar(N, rb = N, groups = LETTERS[1:2], filledBlock = FALSE)
N |
integer for the total sample size of the trial. |
rb |
block lengths of the blocks that can be selected equiprobable at random. |
groups |
character vector of labels for the different treatments. |
filledBlock |
|
Fix the possible random block lengths rb
and the sample size of the trial N
.
Afterwards, one block length is
randomly selected of the random block lengths. In this block a fair coin is tossed
for the patient assignments until half of the patients have been assigned to one of
the treatment arms. Afterwards, the block is filled with the
other treatment. This procedure is repeated
until N
patients are assigned.
S4
object of the class rtbdPar
.
W. F. Rosenberger and J. M. Lachin (2002) Randomization in Clinical Trials. Wiley.
Other randomization procedures:
abcdPar
,
bbcdPar
,
bsdPar
,
chenPar
,
crPar
,
createParam()
,
ebcPar
,
gbcdPar
,
hadaPar
,
mpPar
,
pbrPar
,
rarPar
,
rpbrPar
,
tbdPar
,
udPar
Saves the full information of an assess
object in a .csv
data
sheet.
saveAssess(obj, file = "assessObject.csv")
saveAssess(obj, file = "assessObject.csv")
obj |
object of class assessment, e.g. the output of the |
file |
A connection, or a character string naming the file to write to. |
Creates a .csv
data in the home folder.
Other saving functions:
saveRand()
Saves the parameters of a randSeq
object in a .csv
data
sheet.
saveRand(obj, file = "randList.csv")
saveRand(obj, file = "randList.csv")
obj |
object of class |
file |
A connection, or a character string naming the file to write to. |
Creates a .csv
data in the home folder and saves the randomization list as a column vector.
Other saving functions:
saveAssess()
Method returning the scale parameter of an survEndp S4 object
scale(obj)
scale(obj)
obj |
object of class survEndp |
Returns the seed that was either generated at random or user specified. The seed can be specified for any random operation e.g. genSeq.
seed(obj)
seed(obj)
obj |
object specifying the randomization procedure, see |
Represents the issue of selection bias in a clinical trial.
selBias(type, eta, method, alpha = 0.05, delta = 0)
selBias(type, eta, method, alpha = 0.05, delta = 0)
type |
character string, should be one of |
eta |
numeric specifying the magnitude of selection bias. |
method |
character string, should be one of |
alpha |
significance level. |
delta |
parameter of selection bias used for calculating shape and scale of the Weibull distribution with exponential endpoints |
Selection bias can be an issue in the design of a clinical trial. The
selBias
function is a constructor function
for an S4 object of the class selBias
representing the issue of
third order selection bias in a clinical trial. It supports two possible modes,
method="sim"
and method="exact"
. This representation is
particularly useful in interaction with the assess
function.
method="sim"
Represents the simulated type-I-error rate given
the level alpha
, the selection effect eta
and the biasing
strategy type
. When calling assess
for a selBias
object
with method="sim"
, one test decision is computed for each sequence of
randSeq
. The type-I-error rate (power) is the proportion of falsely
(correctly) rejected null hypotheses.
method="exact"
Represents the exact type-I-error probability
given the level alpha
, the selection effect eta
and the
biasing strategy type
. When calling assess
for a selBias
object with method="exact"
, the p-value of each randomization
sequence is computed. For normal endpoints and two treatment groups these p-values
are exact values which can be calculated from the sum of the corresponding quantiles
of the doubly noncentral t-distribution. For more than two treatment groups, exact
p-values are computed using a doubly noncentral F distribution. For exponential
endpoints the p-values are obtained using an approximation formula.
It also supports three types of selection bias:
type="DS"
Refers to the divergence strategy according to Blackwell and Hodges (1957). Under this guessing strategy, the investigator guesses that the upcoming treatment is the one that has so far been allocated *more* frequently.
type="CS"
Refers to the convergence strategy according to
Blackwell and Hodges (1957). Under this guessing strategy, the investigator
guesses that the upcoming treatment is the one that has so far been allocated
*less* frequently. In multi-arm trials, type="CS"
refers to the first
generalization of the convergence strategy according to Uschner et al (2018).
The investigator guesses the treatment that had been allocated less frequently
whenever all the treatments of the opposite group are larger than the smallest
of the present group.
type="CS2"
In trials with two treatment arms, type="CS2"
is equivalent to type="CS"
. In multi-arm trials, type="CS2"
refers
to the second generalization of convergence strategy according to
Uschner et al (2018).
The investigator guesses the treatment that had been allocated less frequently
whenever all the treatments of the opposite group are larger than the smallest
of the present group.
S4
object of class selBias
, a formal representation of the
issue of selection bias in a clinical trial.
D. Blackwell and J.L. Hodges Jr. (1957) Design for the control of selection bias. Annals of Mathematical Statistics, 25, 449-60.
M. Proschan (1994) Influence of selection bias on the type-I-error rate under random permuted block designs. Statistica Sinica, 4, 219-31.
D. Uschner, R.-D. Hilgers, N. Heussen (2018) The impact of selection bias in randomized multi-arm parallel group clinical trials PLOS ONE, 13(1), 1-18.
Compute exact or simulated rejection probability: assess
.
Other issues:
chronBias
,
combineBias()
,
corGuess
,
imbal
,
issue
,
setPower()
# create a selection bias of the convergency strategy type with eta = 0.25 for which # the exact rejection probabilities are calculated sbias <- selBias("CS", 0.25, "exact")
# create a selection bias of the convergency strategy type with eta = 0.25 for which # the exact rejection probabilities are calculated sbias <- selBias("CS", 0.25, "exact")
Represents the expected power of the individual randomization sequences.
setPower(d, method, alpha = 0.05)
setPower(d, method, alpha = 0.05)
d |
effect size. |
method |
character string, should be one of |
alpha |
significance level. |
The attained power of an individual randomization sequence can be an issue
in the design of a clinical trial. The power of a randomization sequence is
computed depending on the effect size d
and the difference in
group sizes.
If method="sim"
, the object represents the simulated power of an
individual randomization sequence. When calling assess
for a
power
object with method="sim"
, one test decision is computed
for each randomization sequence of randSeq
. The power is the
proportion of falsely (correctly) rejected null hypotheses.
If method="exact"
, the object represents the exact power of an
individual randomization sequence. When calling assess
for a
power
object with method="exact"
, the exact p-value
of each randomization sequence is computed. So far, this is only supported
for normal endpoints. Then the power is the sum of the corresponding
quantiles of the noncentral t-distribution.
S4
object of class power
, a formal representation of the
issue of power in a clinical trial.
Other issues:
chronBias
,
combineBias()
,
corGuess
,
imbal
,
issue
,
selBias
Method returning the shape parameter of an survEndp S4 object
shape(obj)
shape(obj)
obj |
object of class survEndp |
Function returning the standard deviation slot of a normEndp S4 object
sigma(obj)
sigma(obj)
obj |
object of class normEndp |
Summary of assessments of a randomization procedure
Summary of desirability scores of a randomization procedure
summary(object, ...) ## S4 method for signature 'assessment' summary(object) summary(object, ...) ## S4 method for signature 'desScores' summary(object)
summary(object, ...) ## S4 method for signature 'assessment' summary(object) summary(object, ...) ## S4 method for signature 'desScores' summary(object)
object |
assessment object. |
... |
additional arguments affecting the summary that will be produced. |
For each issue the assessment of the sequences is summarized to permit a design-based assessment of the randomization procedure. This approach uses the sequence-wise values of the assessment and the probabilities in order to give an overall summary.
For each issue the desirability score of the sequences is summarized to permit a design-based desirability score of the randomization procedure. This approach uses the sequence-wise values of the desirability and the probabilities in order to give an overall summary.
Data frame with a summary of the assessment object.
Data frame with a summary of the desirability scores object.
# assess the full set of PBR(4) seq <- getAllSeq(pbrPar(4)) issue <- corGuess("CS") A <- assess(seq, issue) summary(A) # compute the desirability scores of the full set of PBR(4) seq <- getAllSeq(pbrPar(4)) issue1 <- corGuess("CS") issue2 <- corGuess("DS") A <- assess(seq, issue1, issue2) d1 <- derFunc(0.5, c(0.1, 0.8), c(1, 1)) d2 <- derFunc(0.1, 0.7, 2) D <- getDesScores(A, d1, d2, weights = c(5/6, 1/6)) summary(D)
# assess the full set of PBR(4) seq <- getAllSeq(pbrPar(4)) issue <- corGuess("CS") A <- assess(seq, issue) summary(A) # compute the desirability scores of the full set of PBR(4) seq <- getAllSeq(pbrPar(4)) issue1 <- corGuess("CS") issue2 <- corGuess("DS") A <- assess(seq, issue1, issue2) d1 <- derFunc(0.5, c(0.1, 0.8), c(1, 1)) d2 <- derFunc(0.1, 0.7, 2) D <- getDesScores(A, d1, d2, weights = c(5/6, 1/6)) summary(D)
Represents survival endpoints in clinical trials.
survEndp( cenRate, accrualTime = 0, cenTime, shape, scale, weights = c(0, 0), maxcombo = FALSE )
survEndp( cenRate, accrualTime = 0, cenTime, shape, scale, weights = c(0, 0), maxcombo = FALSE )
cenRate |
exponential censoring rate in a survival study. |
accrualTime |
duration of the accrual period in a survival study. |
cenTime |
total duration of a survival study (maximum length of followup). |
shape |
parameter of the Weibull distribution (must be positive) |
scale |
parameter of the Weibull distribution (must be positive) |
weights |
numeric specifying the weights used for the test. Unless specified an unweighted test is conducted. |
maxcombo |
logical specifying if the maxcombo test is used |
The survEnd
function is a constructor function
for an S4 object of the class survEnd
representing
a survival endpoint in a clinical trial.
A S4
object representing
a survival endpoint in a clinical trial.
Compute exact or simulated type-I-error: assess
.
Other endpoint types:
expEndp
,
normEndp
Represents the Truncated Binomial Design.
tbdPar(bc = N, groups = LETTERS[1:2])
tbdPar(bc = N, groups = LETTERS[1:2])
bc |
vector which contains the lengths |
groups |
character vector of labels for the different treatments. |
A fair coin is tossed until half of the patients have been assigned to one of the treatment arms. Afterwards, the randomization list is filled with the other treatment.
S4 object of the class tbdPar
.
W. F. Rosenberger and J. M. Lachin (2002) Randomization in Clinical Trials. Wiley.
Other randomization procedures:
abcdPar
,
bbcdPar
,
bsdPar
,
chenPar
,
crPar
,
createParam()
,
ebcPar
,
gbcdPar
,
hadaPar
,
mpPar
,
pbrPar
,
rarPar
,
rpbrPar
,
rtbdPar
,
udPar
Function returning the target value slot of an S4 object
TV(obj)
TV(obj)
obj |
object inheriting from derFunc |
Accesses the type slot of an S4 object
type(obj)
type(obj)
obj |
a bias object (i.e. S4 object inheriting from |
Character string specifying the type of bias obj
represents, e.g. "linT"
in
case of chronological bias.
Represents Wei's Urn Design.
udPar(N, ini, add, groups = LETTERS[1:2])
udPar(N, ini, add, groups = LETTERS[1:2])
N |
integer for the total sample size of the trial. |
ini |
integer representing the initial urn composition. |
add |
integer representing the number of balls that are added to the urn in each step. |
groups |
character vector of labels for the different treatments. |
An urn is filled with a number of ini
balls of both of the treatments.
Afterwards, a ball is drawn randomly from the urn. Finally, add
balls
are added to the urn from the opposite treatment. This procedure is repeated until
N
patients are assigned.
S4
object of the class udPar
.
L.J. Wei (1977) A Class of Designs for Sequential Clinical Trials. Journal of the American Statistical Association, 72, 382-6.
Other randomization procedures:
abcdPar
,
bbcdPar
,
bsdPar
,
chenPar
,
crPar
,
createParam()
,
ebcPar
,
gbcdPar
,
hadaPar
,
mpPar
,
pbrPar
,
rarPar
,
rpbrPar
,
rtbdPar
,
tbdPar