Implements a wide range of model-based dose escalation designs, ranging from classical and modern continual reassessment methods (CRMs) based on dose-limiting toxicity endpoints to dual-endpoint designs taking into account a biomarker/efficacy outcome. The focus is on Bayesian inference, making it very easy to setup a new design with its own JAGS code. However, it is also possible to implement 3+3 designs for comparison or models with non-Bayesian estimation. The whole package is written in a modular form in the S4 class system, making it very flexible for adaptation to new models, escalation or stopping rules.
The goal of crmPack is to implement a wide range of model-based dose escalation designs, ranging from classical and modern continual reassessment methods (CRMs) based on dose-limiting toxicity endpoints to dual-endpoint designs taking into account a biomarker/efficacy outcome. The focus is on Bayesian inference, making it very easy to setup a new design with your own JAGS code. However, it is also possible to implement 3+3 designs for comparison or models with non-Bayesian estimation. The whole package is written in a modular form in the S4 class system, making it very flexible for adaptation to new models, escalation or stopping rules.
You can install the development version of crmPack from github with:
devtools::install_github("Roche/crmPack")
You can install the stable release version of crmPack from CRAN with:
install.packages("crmPack")
This is a basic example which shows how to run simulations from a CRM with a 2-parameter logistic regression model, using a log normal prior distribution, and custom cohort size, stopping and maximum increments rules:
library(crmPack)#> Warning: package 'crmPack' was built under R version 3.4.4#> Loading required package: ggplot2#> Warning: package 'ggplot2' was built under R version 3.4.4#> Type crmPackHelp() to open help browser#> Type crmPackExample() to open example# Define the dose-gridemptydata <- Data(doseGrid = c(1, 3, 5, 10, 15, 20, 25, 40, 50, 80, 100))# Initialize the CRM modelmodel <- LogisticLogNormal(mean=c(-0.85, 1),cov=matrix(c(1, -0.5, -0.5, 1),nrow=2),refDose=56)# Choose the rule for selecting the next dosemyNextBest <- NextBestNCRM(target=c(0.2, 0.35),overdose=c(0.35, 1),maxOverdoseProb=0.25)# Choose the rule for the cohort-sizemySize1 <- CohortSizeRange(intervals=c(0, 30),cohortSize=c(1, 3))mySize2 <- CohortSizeDLT(DLTintervals=c(0, 1),cohortSize=c(1, 3))mySize <- maxSize(mySize1, mySize2)# Choose the rule for stoppingmyStopping1 <- StoppingMinCohorts(nCohorts=3)myStopping2 <- StoppingTargetProb(target=c(0.2, 0.35),prob=0.5)myStopping3 <- StoppingMinPatients(nPatients=20)myStopping <- (myStopping1 & myStopping2) | myStopping3# Choose the rule for dose incrementsmyIncrements <- IncrementsRelative(intervals=c(0, 20),increments=c(1, 0.33))# Initialize the designdesign <- Design(model=model,nextBest=myNextBest,stopping=myStopping,increments=myIncrements,cohortSize=mySize,data=emptydata,startingDose=3)## define the true functionmyTruth <- function(dose){[email protected](dose, alpha0=7, alpha1=8)}# Run the simulation on the desired design# We only generate 1 trial outcomes here for illustration, for the actual study# this should be increased of courseoptions <- McmcOptions(burnin=100,step=1,samples=2000)time <- system.time(mySims <- simulate(design,args=NULL,truth=myTruth,nsim=1,seed=819,mcmcOptions=options,parallel=FALSE))[3]
By default only use 5 cores and not all available cores on a machine. Note that this value can also be changed by the user.
Change of maintainer
PLcohortSize now defaults to 0 placebo patients upon Design class initialization (instead of 1 before - but note that this did not have effect on erroneous simulations, due to option being set in Data class)
The "examine" function also stops when the stopping rules are fulfilled already in case of no DLTs occurring. This was not the case beforehand and could lead to infinite looping (thanks to John Kirkpatrick for reporting the bug)
Removed RW2 warnings in "DualEndpointRW" - it seems to work nicely now (thanks to Charles Warne for reporting!)
Removed WinBUGS since it was not used anyway (and paper does not describe it)
The "examine" function now counts the number of times the same dose is recommended contiguously and break after e.g. the default 100 times (can be specified in a new option of "examine") to further avoid infinite loops and issues a corresponding warning if this condition is met
New "Increments" class "IncrementsNumDoseLevels" that works directly on the number of dose levels in the dose grid that can be incremented to from the current to the next cohort (thanks to John Kirkpatrick for the suggestion). This can for example be used in order to force the design not to skip any dose level when escalating.
Included the JSS manuscript as a new vignette.
It is now possible to specify how many cores should be used when parallel computations are used.
Replaced BayesLogit dependency by JAGS code, since BayesLogit was taken off CRAN.
Speed up one example to pass CRAN check.
documentation:
minor fix on scale_colour_manual import from ggplot2 reported by R-Core
Option targetThresh for NextBestDualEndpoint allows to tune from which target probability onwards it will be used to derive the next best dose (before this was fixed to 0.05)
Added ProbitLogNormal model
In the NextBestDualEndpoint class, the additional option "scale" now allows to also specify absolute biomarker target ranges. In the corresponding method evaluation, the safety samples are now no longer included in the evaluation of the biomarker target probability, such that now the description is consistent with the computations.
NextBestNCRM and NextBestDualEndpoint now return the matrix of target and overdosing probabilities as additional list element "probs" in the result of "nextBest" applied.
Note that in the StoppingTargetBiomarker evaluation, the toxicity is no longer a part of the biomarker target probability.
Added back the example vignette, so that it can be opened with crmPackExample()
Clarified that for the DualEndpointRW model samples from the prior cannot be obtained due to impropriety of the RW prior (added to model class description).
For DualEndpointRW models, it is now possible to have non-equidistant grid points, and obtain sensible results. (But still needs to be thouroughly tested though.)
For DualEndpointBeta model, it is now possible to have negative E0 and Emax parameters.
Cohort size of 0 for placebo is now possible - e.g. to only start with patients and then later move to larger cohorts also including placebo subjects.
When simulating with firstSeparate=TRUE and placebo, now the first (sentinel) cohort includes one active and one placebo patients, and the next patients use the cohort size for the active and placebo arms, respectively.
Barplots work now also when there was only one observed value in all simulations
NextBestDualEndpoint now only takes into account active doses when optimizing the biomarker outcome for the next best dose among admissible doses, thus avoiding early stopping at the placebo dose level.
If DataMixture objects are used, mcmc now correctly sets fromPrior to FALSE if the shared data object contains any data.
Added arguments probmin and probmax to MinimalInformative in order to control the probability threshold at the minimum and maximum dose for the minimally informative prior
Values of 95% CI and the corresponding ratio of the upper to the lower limit of this CI are displayed in results when using 'nextBest'
The six- number summary tables including the values of the lowest, 25th percentile, 50th percentile or the median, the mean, the 75th precentile and the highest of the final (at stopping) estimates of the
across all simulations will also be displayed when using 'summary' for simulations.
The value of the 95% CI of the final estimates will be displayed in results when using 'stopTrial'
Bugfixes for dual endpoint designs:
New model class "LogisticLogNormalMixture" has been added, for use with the new data class "DataMixture".
New stopping rule "StoppingHighestDose" has been added.
The "examine" method no longer stops when two consecutive cohorts start with the same dose. This is important e.g. for the two-parts study designs, where part 1 can end with the same dose as part 2 starts.
The contents of the "datanames" slot of new models are no longer restricted to a specific set, which was previously enforced by the validation function of the GeneralModel and AllModels classes.
Sampling from the prior can now be enabled/disabled by the user for the mcmc function, which is necessary for models where it might not be from the prior even though nObs == 0.
Bugfix: The results from the MinimalInformative function were not reproducible beforehand. Now a seed parameter can be supplied, which ensures reproducibility.
Bugfix: Compatibility of help file links with new ggplot2 package version.
Added examine function to generate a table of hypothetical trial courses for model-based and rule-based DLT-endpoint designs
Made results from mcmc() (works with the usual set.seed in earlier user code) and simulate() (as previously already promised) reproducible. See help file for mcmc for more details. Additional improvements to reduce confusing warning messages / notes from mcmc() and higher-level functions.
Made simulate with parallel=TRUE work on r.roche.com (Linux server), using the same parallelization method as for laptops (Windows)
Passing an empty (zero length) vector as the doselimit parameter of the nextBest function is now considered as requesting a dose recommendation without a strict dose limit, and a corresponding warning is printed.
Introduced GeneralModel class, from which then the class Model for single agent dose escalation derives. Another branch will be the ComboLogistic model for multiple agent combinations (in a future version). Similarly introduced GeneralData class, from which the class Data for single agent derives, separately from that will be the subclass DataCombo (in a future version).
Fixed bug in mcmc function which led to error "all data elements must have as many rows as the sample size was" and slightly changed JAGS way of handling burnin / thinning (which should not have a user impact).
Reduced number of MCMC samples for dual-endpoint example in vignette to be able to plot the vignette
simulate function has been fixed (specification of arguments)
Dual-endpoint model-based design has been added.
3+3 design simulation is now possible, see ?ThreePlusThreeDesign
Welcome message on attaching crmPack, i.e. when library("crmPack") is run
crmPackUpgrade() function for easy upgrade of crmPack to the latest version
Rule-based designs now can be specified with the class RuleDesign, while the model-based designs stay with the class Design. An even more special class is the DualDesign class, for dual-endpoint model-based designs. Corresponding classes GeneralSimulations, Simulations and DualSimulations capture the output of the trial simulations for rule-based, model-based and dual-endpoint designs.
The class Simulations-summary has been renamed to SimulationsSummary, similarly for the classes GeneralSimulationsSummary and DualSimulationsSummary.
All Stopping and CohortSize rules that are based on intervals (IncrementsRelative, IncrementsRelativeDLT, CohortSizeRange, CohortSizeDLT) now use a different intervals definition. Now the "intervals" slots only contain the left bounds of the intervals. Before, the last element needed to be infinity. See the vignette for examples.
StoppingMaxPatients class has been removed, as it was redundant with the class StoppingMinPatients. Please just use the StoppingMinPatients class instead.
Initialization methods have been replaced by dedicated initialization functions. Please now use these Class(...) functions instead of new("Class", ...) calls to obtain the correct objects. This change is also reflected in the vignette.
The extract function for extracting parameter samples from Samples objects has been removed (due to a name conflict with ggmcmc dependency packages). Please now use instead the "get" method for Samples objects (see the vignette for an example) to obtain data in the ggmcmc format.
crmPack now needs the package httr (it's now in the "Imports" field). Packages Rcpp and RcppArmadillo have been moved from "Depends" to "Suggests" packages. Currently we are not using them at all.
showLegend argument for model fit plotting functions, in order to show the legend or not.
no NEWS until this version