Learn R Programming

DoseFinding (version 0.1-3)

calcOptDesign: Function to calculate an optimal design

Description

Given a set of models (with full parameter values and model probabilities) this function calculates the MED optimal design (see Dette, Bretz, Pepelyshev and Pinheiro (2008) for details) or the D-optimal design, or a mixture of these two criteria.

Usage

calcOptDesign(fullModels, weights, doses, clinRel = NULL, nold = rep(0, length(doses)), 
             n2 = NULL, control = list(),  scal=1.2*max(doses), off=0.1*max(doses),
             type = c("MED", "Dopt", "MED&Dopt"),
             method = c("Nelder-Mead", "nlminb", "mult", "solnp"),
             lowbnd = rep(0, length(doses)), uppbnd = rep(1, length(doses)),
             tundelta = NULL)

Arguments

fullModels
List containing all model parameters for the models (can for example be a fullMod object, see the fullMod function for details). When an MED optimal design should be calculated the MED needs to
weights
Vector of model probabilities for the models specified in fullModels.
doses
Doses available
clinRel
Clinical relevance needed for calculating "MED" and "MED&Dopt" type designs.
nold
Vector of sample sizes already allocated to the different doses.
n2
Sample size for next cohort.
control
List containing control parameters passed down to numerical optimization algorithms (optim, nlminb or solnp function)
scal
Scal parameter for beta model
off
Offset parameter for linlog model
type
Determines which type of design to calculate. "MED&Dopt" uses both optimality criteria with equal weight.
method
Algorithm used for calculating the optimal design. Options "Nelder-Mead" and "nlminb" use the optim respectively the nlminb function and use trigonometric
lowbnd, uppbnd
Vectors of the same length as dose vector specifying upper and lower limits for the allocation weights. This option is only available when using the "solnp" optimizer.
tundelta
Tuning parameter for mult optimization.

Details

The difference to the methodology proposed in Dette et al. (2008) is the fact that the doses are treated as fixed (and specified via doses): The design is only optimized with respect to the design weights (ie the allocation weights for the different doses).

References

Atkinson, A.C., Donev, A.N. and Tobias, R.D. (2007). Optimum Experimental Designs, with SAS, Oxford University Press Dette, H., Bretz, F., Pepelyshev, A. and Pinheiro, J. C. (2008). Optimal Designs for Dose Finding Studies, Journal of the American Statisical Association, 103, 1225--1237 Torsney, B. and Mandal, S. (2006). Two classes of multiplicative algorithms for constructing optimizing distributions, Computational Statistics and Data Analysis, 51, 1591--1601

Examples

Run this code
# first example calculate MED optimal design for Emax model
mods <- list(emax = 25)
doses <- c(0,150)
fMod <- fullMod(mods, doses, base=0, maxEff=0.4)
fMod$emax[2] <- 0.6666667
doses <- c(0, 18.75, 150)
weights <- c(1) # just one model
# by default calculates MED optimal design
des1 <- calcOptDesign(fMod, weights, doses, clinRel=0.2) 
des2 <- calcOptDesign(fMod, weights, doses, type = "Dopt")
des3 <- calcOptDesign(fMod, weights, doses, clinRel=0.2, type = "MED&Dopt")

# illustrating the different optimizers
des1 <- calcOptDesign(fMod, weights, doses, clinRel=0.2, method="Nelder-Mead")
des2 <- calcOptDesign(fMod, weights, doses, clinRel=0.2, method="nlminb")
des3 <- calcOptDesign(fMod, weights, doses, clinRel=0.2, method="mult")
des4 <- calcOptDesign(fMod, weights, doses, clinRel=0.2, method="solnp")
# now assume additional constraints (only available for method = solnp)
des5 <- calcOptDesign(fMod, weights, doses, clinRel=0.2, lowbnd = rep(0.2,3),
        uppbnd = rep(0.45, 3), method="solnp")

# larger candidate model set
doses <- c(0, 10, 25, 50, 100, 150)
mods <- list(linear = NULL, emax = 25, exponential = 85,
               linlog = NULL, logistic = c(50, 10.8811))
fMod <- fullMod(mods, doses, base=0, maxEff=0.4, off=1)
weights <- rep(1/5, 5)
desMED <- calcOptDesign(fMod, weights, doses, clinRel=0.2, scal=200,
                        off=1, method = "nlminb")
desDopt <- calcOptDesign(fMod, weights, doses, scal=200, off=1, 
                         type = "Dopt")
desMix <- calcOptDesign(fMod, weights, doses, clinRel=0.2, scal=200,
                        off=1, type = "MED&Dopt")
# allocated 100 persons according to desMix design
rndDesign(desMix$design, 100)

########################################################################
#### using already allocated patients
mods <- list(betaMod = c(0.33, 2.31))
doses <- c(0,150)
fMod <- fullMod(mods, doses, base=0, maxEff=0.4, scal=200)
doses <- c(0, 0.49, 25.2, 108.07, 150)
weights <- c(1)
# no previously allocated patients
des <- calcOptDesign(fMod, weights, doses, clinRel=0.1, scal=200, control=list(maxit=1000))

# now use previously allocated patients
nold <- c(45, 50, 0, 0, 0)
des2 <- calcOptDesign(fMod, weights, doses, clinRel=0.1, n2=30, scal=200,
         off=1, control=list(maxit=1000), nold=nold)
# the overall design
(30*des2$design+nold)/(30+sum(nold))
des$design

Run the code above in your browser using DataLab