Learn R Programming

crmPack (version 1.0.6)

Object-Oriented Implementation of CRM Designs

Description

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.

Copy Link

Version

Install

install.packages('crmPack')

Monthly Downloads

420

Version

1.0.6

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Last Published

June 26th, 2024

Functions in crmPack (1.0.6)

Data-class

Class for the data input
CohortSizeParts

Initialization function for "CohortSizeParts"
Data

Initialization function for the "Data" class
CohortSizeParts-class

Cohort size based on the parts
CohortSizeRange-class

Cohort size based on dose range
CohortSizeRange

Initialization function for "CohortSizeRange"
DualEndpointBeta-class

Dual endpoint model with beta function for dose-biomarker relationship
DualEndpoint

Initialization function for the "DualEndpoint" class
DataMixture

Initialization function for the "DataMixture" class
DualEndpoint-class

General class for the dual endpoint model
DualDesign

Initialization function for "DualDesign"
DataDual

Initialization function for the "DataDual" class
DataDual-class

Class for the dual endpoint data input
DataParts-class

Class for the data with two study parts
DualEndpointBeta

Initialization function for the "DualEndpointBeta" class
DataMixture-class

Class for the data with mixture sharing
DataParts

Initialization function for the "DataParts" class
DualEndpointRW-class

Dual endpoint model with RW prior for biomarker
DualDesign-class

Class for the dual-endpoint CRM design
DualEndpointOld-class

Dual endpoint model
DualEndpointEmax-class

Dual endpoint model with emax function for dose-biomarker relationship
Design-class

Class for the CRM design
DualSimulations-class

Class for the simulations output from dual-endpoint model based designs
DualResponsesSamplesDesign

Initialization function for 'DualResponsesSamplesDesign"
GeneralModel-class

No Intitialization function for this General class for model input
GeneralSimulations-class

General class for the simulations output
GeneralData-class

Class for general data input
ExpEff

Compute the expected efficacy based on a given dose, a given pseudo Efficacy log-log model and a given efficacy sample
Increments-class

The virtual class for controlling increments
GeneralSimulationsSummary-class

Class for the summary of general simulations output
EffFlexi-class

Class for the efficacy model in flexible form for prior expressed in form of pseudo data
IncrementsNumDoseLevels-class

Increments control based on number of dose levels
GeneralSimulations

Initialization function for "GeneralSimulations"
DualResponsesDesign

Initialization function for 'DualResponsesDesign"
DualResponsesSamplesDesign-class

This is a class of design based on DLE responses using the LogisticIndepBeta model model and efficacy responses using ModelEff model class with DLE and efficacy samples.It contain all slots in RuleDesign and TDsamplesDesign class object
IncrementsRelativeDLT-class

Increments control based on relative differences in terms of DLTs
DualEndpointEmax

Initialization function for the "DualEndpointEmax" class
IncrementsRelative

Initialization function for "IncrementsRelative"
EffFlexi

Initialization function for the "EffFlexi" class
IncrementsRelativeDLT

Initialization function for "IncrementsRelativeDLT"
IncrementMin-class

Max increment based on minimum of multiple increment rules
DualResponsesDesign-class

This is a class of design based on DLE responses using the LogisticIndepBeta model model and efficacy responses using ModelEff model class without DLE and efficacy samples. It contain all slots in RuleDesign and TDDesign class object
IncrementMin

Initialization function for "IncrementMin"
DualSimulationsSummary-class

Class for the summary of dual-endpoint simulations output
Effloglog

Initialization function for the "Effloglog" class
Effloglog-class

Class for the linear log-log efficacy model using pseudo data prior
DualEndpointRW

Initialization function for the "DualEndpointRW" class
Design

Initialization function for "Design"
LogisticNormalFixedMixture

Initialization function for the "LogisticNormalFixedMixture" class
LogisticLogNormal

Initialization function for the "LogisticLogNormal" class
DualSimulations

Initialization function for "DualSimulations"
LogisticLogNormalMixture

Initialization function for the "LogisticLogNormalMixture" class
LogisticNormalMixture-class

Standard logistic model with flexible mixture of two bivariate normal priors
IncrementsRelativeParts

Initialization function for "IncrementsRelativeParts"
LogisticIndepBeta-class

No initialization function Standard logistic model with prior in form of pseudo data
IncrementsNumDoseLevels

Initialization function for "IncrementsNumDoseLevels"
LogisticLogNormal-class

Standard logistic model with bivariate (log) normal prior
McmcOptions

Initialization function for the "McmcOptions" class
LogisticNormalMixture

Initialization function for the "LogisticNormalMixture" class
IncrementsRelativeParts-class

Increments control based on relative differences in intervals, with special rules for part 1 and beginning of part 2
LogisticKadane-class

Reparametrized logistic model
LogisticKadane

Initialization function for the "LogisticKadane" class
IncrementsRelative-class

Increments control based on relative differences in intervals
NextBestDualEndpoint

Initialization function for "NextBestDualEndpoint"
NextBestMaxGain-class

Next best dose with maximum gain value based on a pseudo DLE and efficacy model without samples
NextBestMTD

Initialization function for class "NextBestMTD"
LogisticLogNormalSub-class

Standard logistic model with bivariate (log) normal prior with substractive dose standardization
LogisticIndepBeta

Intialization function for "LogisticIndepBeta" class
NextBestMTD-class

The class with the input for finding the next best MTD estimate
MinimalInformative

Construct a minimally informative prior
McmcOptions-class

Class for the three canonical MCMC options
PseudoDualSimulations

Initialization function for 'DualPseudoSimulations' class
LogisticNormal

Initialization function for the "LogisticNormal" class
LogisticNormalFixedMixture-class

Standard logistic model with fixed mixture of multiple bivariate (log) normal priors
PseudoDualSimulationsSummary-class

Class for the summary of the dual responses simulations using pseudo models
LogisticLogNormalMixture-class

Standard logistic model with online mixture of two bivariate log normal priors
NextBestThreePlusThree

Initialization function for "NextBestThreePlusThree"
ProbitLogNormal-class

Probit model with bivariate log normal prior
NextBest-class

The virtual class for finding next best dose
NextBestMaxGain

Initialization function for the class 'NextBestMaxGain'
LogisticLogNormalSub

Initialization function for the "LogisticLogNormalSub" class
LogisticNormal-class

Standard logistic model with bivariate normal prior
NextBestDualEndpoint-class

The class with the input for finding the next dose based on the dual endpoint model
PseudoDualFlexiSimulations

Initialization function for 'PseudoDualFlexiSimulations' class
Report

A Reference Class to represent sequentially updated reporting objects.
ModelEff-class

No Initialization function class for Efficacy models using pseudo data prior
NextBestTDsamples-class

Next best dose based on Pseudo DLE Model with samples
PseudoDualSimulations-class

This is a class which captures the trial simulations design using both the DLE and efficacy responses. The design of model from ModelTox class and the efficacy model from ModelEff class (except EffFlexi class). It contains all slots from GeneralSimulations and PseudoSimulations object. In comparison to the parent class PseudoSimulations, it contains additional slots to capture the dose-efficacy curve and the sigma2 estimates.
Model-class

Class for the model input
NextBestTD

Initialization function for the class "NextBestTD"
RuleDesign-class

Class for rule-based designs
StoppingAny

Initialization function for "StoppingAny"
NextBestMaxGainSamples-class

Next best dose with maximum gain value based on a pseudo DLE and efficacy model with samples
ModelPseudo-class

Class of models using expressing their prior in form of Pseudo data
Samples

Initialization function for "Samples"
NextBestNCRM-class

The class with the input for finding the next dose in target interval
NextBestMaxGainSamples

Initialization function for class "NextBestMaxGainSamples"
ModelTox-class

No intialization function Class for DLE models using pseudo data prior. This is a class of DLE (dose-limiting events) models/ toxicity model which contains all DLE models for which their prior are specified in form of pseudo data (as if there is some data before the trial starts). It inherits all slots from ModelPseudo
NextBestThreePlusThree-class

The class with the input for finding the next dose in target interval
StoppingList

Initialization function for "StoppingList"
Simulations-class

Class for the simulations output from model based designs
StoppingTargetProb

Initialization function for "StoppingTargetProb"
StoppingCohortsNearDose-class

Stop based on number of cohorts near to next best dose
&,Stopping,StoppingAll-method

The method combining an atomic and a stopping list
PseudoSimulationsSummary-class

Class for the summary of pseudo-models simulations output
NextBestTDsamples

Initialization function for class "NextBestTDsamples"
PseudoSimulations-class

This is a class which captures the trial simulations from designs using pseudo model. The design for DLE only responses and model from ModelTox class object. It contains all slots from GeneralSimulations object. Additional slots fit and stopReasons compared to the general class GeneralSimulations.
StoppingGstarCIRatio

Initialization function for "StoppingGstarCIRatio"
PseudoSimulations

Initialization function of the 'PseudoSimulations' class
StoppingMTDdistribution-class

Stop based on MTD distribution
StoppingHighestDose-class

Stop when the highest dose is reached
StoppingMinPatients

Initialization function for "StoppingMinPatients"
approximate

Approximate posterior with (log) normal distribution
StoppingAll-class

Stop based on fullfillment of all multiple stopping rules
TDDesign-class

Design class using DLE responses only based on the pseudo DLE model without sample
Stopping-class

The virtual class for stopping rules
StoppingPatientsNearDose-class

Stop based on number of patients near to next best dose
SimulationsSummary-class

Class for the summary of model-based simulations output
StoppingMTDdistribution

Initialization function for "StoppingMTDdistribution"
NextBestNCRM

Initialization function for "NextBestNCRM"
StoppingMinCohorts-class

Stop based on minimum number of cohorts
StoppingMinCohorts

Initialization function for "StoppingMinCohorts"
StoppingTDCIRatio

Initialization function for "StoppingTDCIRatio"
Simulations

Initialization function for the "Simulations" class
StoppingTargetBiomarker-class

Stop based on probability of target biomarker
as.list,GeneralData-method

as.list method for the "GeneralData" class
Validate

A Reference Class to help programming validation for new S4 classes
Quantiles2LogisticNormal

Convert prior quantiles (lower, median, upper) to logistic (log) normal model
StoppingMinPatients-class

Stop based on minimum number of patients
&,Stopping,Stopping-method

The method combining two atomic stopping rules
StoppingAll

Initialization function for "StoppingAll"
examine

Obtain hypothetical trial course table for a design
dinvGamma

Compute the density of Inverse gamma distribution
NextBestTD-class

Next best dose based on Pseudo DLE model without sample
ProbitLogNormal

Initialization function for the "ProbitLogNormal" class
&,StoppingAll,Stopping-method

The method combining a stopping list and an atomic
StoppingAny-class

Stop based on fullfillment of any stopping rule
fit

Fit method for the Samples class
fitGain

Get the fiited values for the gain values at all dose levels based on a given pseudo DLE model, DLE sample, a pseudo efficacy model, a Efficacy sample and data. This method returns a data frame with dose, middle, lower and upper quantiles of the gain value samples
is.probability

Predicate checking for a probability
is.probRange

Predicate checking for a probability range
PseudoDualFlexiSimulations-class

This is a class which captures the trial simulations design using both the DLE and efficacy responses. The design of model from ModelTox class and the efficacy model from EffFlexi class It contains all slots from GeneralSimulations, PseudoSimulations and PseudoDualSimulations object. In comparison to the parent class PseudoDualSimulations, it contains additional slots to capture the sigma2betaW estimates.
gain

Compute the gain value with a given dose level, given a pseudo DLE model, a DLE sample, a pseudo Efficacy log-log model and a Efficacy sample
maxDose

Determine the maximum possible next dose
initialize,DualEndpointOld-method

Initialization method for the "DualEndpointOld" class
matchTolerance

Helper function for value matching with tolerance
StoppingPatientsNearDose

Initialization function for "StoppingPatientsNearDose"
is.bool

Predicate checking for a boolean option
maxSize

"MAX" combination of cohort size rules
is.wholenumber

checks for whole numbers (integers)
getMinInfBeta

Get the minimal informative unimodal beta distribution
mcmc

Obtain posterior samples for all model parameters
getResultList

Helper function to obtain simulation results list
RuleDesign

Initialization function for "RuleDesign"
ThreePlusThreeDesign

Creates a new 3+3 design object from a dose grid
StoppingTDCIRatio-class

Stop based on a target ratio, the ratio of the upper to the lower 95% credibility interval of the estimate of TD end of trial, the dose with probability of DLE equals to the target probability of DLE used at the end of a trial
Samples-class

Class for the MCMC output
dose

Compute the doses for a given probability, given model and samples
TDsamplesDesign

Initialization function for 'TDsamplesDesign' class
is.range

Predicate checking for a numeric range
crmPackHelp

Open the browser with help pages for crmPack
crmPackExample

Open the example pdf for crmPack
joinBodies

Helper function to join two function bodies
multiplot

Multiple plot function
StoppingCohortsNearDose

Initialization function for "StoppingCohortsNearDose"
StoppingList-class

Stop based on multiple stopping rules
nextBest

Find the next best dose
is.scalar

Checking for scalar
minSize

"MIN" combination of cohort size rules
noOverlap

Check overlap of two character vectors
StoppingGstarCIRatio-class

Stop based on a target ratio, the ratio of the upper to the lower 95% credibility interval of the estimate of the minimum of the dose which gives the maximum gain (Gstar) and the TD end of trial, the dose with probability of DLE equals to the target probability of DLE used at the end of a trial.
StoppingHighestDose

Initialization function for "StoppingHighestDose"
plot,Data,ModelTox-method

Plot of the fitted dose-tox based with a given pseudo DLE model and data without samples
plot,Data,missing-method

Plot method for the "Data" class
pinvGamma

Compute the distribution function of Inverse gamma distribution
plot,PseudoDualSimulations,missing-method

Plot simulations
StoppingTargetBiomarker

Initialization function for "StoppingTargetBiomarker"
plot,PseudoDualFlexiSimulations,missing-method

Plot for PseudoDualFlexiSimulations
or-Stopping-StoppingAny

The method combining a stopping list and an atomic
or-Stopping-Stopping

The method combining two atomic stopping rules
or-StoppingAny-Stopping

The method combining an atomic and a stopping list
StoppingTargetProb-class

Stop based on probability of target tox interval
plot,DualSimulations,missing-method

Plot dual-endpoint simulations
plot,DataDual,ModelEff-method

Plot of the fitted dose-efficacy based with a given pseudo efficacy model and data without samples
plot,DualSimulationsSummary,missing-method

Plot summaries of the dual-endpoint design simulations
plot,DataDual,missing-method

Plot method for the "DataDual" class
biomLevel

Compute the biomarker level for a given dose, given model and samples
plot.gtable

Plots gtable objects
TDsamplesDesign-class

This is a class of design based only on DLE responses using the 'LogisticIndepBeta' class model and DLE samples are also used. In addition to the slots in the more simple RuleDesign, objects of this class contain:
TDDesign

Initialization function for 'TDDesign' class
plot,Samples,Model-method

Plotting dose-toxicity model fits
plot,Samples,DualEndpoint-method

Plotting dose-toxicity and dose-biomarker model fits
myBarplot

Convenience function to make barplots of percentages
myBayesLogit

Do MCMC sampling for Bayesian logistic regression model
plotDualResponses

Plot of the DLE and efficacy curve side by side given a DLE pseudo model, a DLE sample, an efficacy pseudo model and a given efficacy sample
plot,SimulationsSummary,missing-method

Plot summaries of the model-based design simulations
getEff

Extracting efficacy responses for subjects without or with a DLE. This is a class where we separate efficacy responses with or without a DLE. It outputs the efficacy responses and their corresponding dose levels treated at in two categories (with or without DLE)
logit

Shorthand for logit function
plot,GeneralSimulationsSummary,missing-method

Graphical display of the general simulation summary
get,Samples,character-method

Get specific parameter samples and produce a data.frame
crmPack-package

Object-oriented implementation of CRM designs
printVignette

Taken from utils package (print.vignette)
plotGain

Plot the gain curve in addition with the dose-DLE and dose-efficacy curve using a given DLE pseudo model, a DLE sample, a given efficacy pseudo model and an efficacy sample
plot,GeneralSimulations,missing-method

Plot simulations
joinModels

Helper function to join two BUGS models
probit

Shorthand for probit function
qinvGamma

Compute the quantile function of Inverse gamma distribution
sampleSize

Compute the number of samples for a given MCMC options triple
safeInteger

Safe conversion to integer vector
prob

Compute the probability for a given dose, given model and samples
rinvGamma

The random generation of the Inverse gamma distribution
setSeed

Helper function to set and save the RNG seed
show,DualSimulationsSummary-method

Show the summary of the dual-endpoint simulations
saveSample

Determine if we should save this sample
simulate,TDDesign-method

This is a methods to simulate dose escalation procedure only using the DLE responses. This is a method based on the TDDesign where model used are of ModelTox class object and no samples are involved.
simulate,RuleDesign-method

Simulate outcomes from a rule-based design
simulate,TDsamplesDesign-method

This is a methods to simulate dose escalation procedure only using the DLE responses. This is a method based on the TDsamplesDesign where model used are of ModelTox class object DLE samples are also used
plot,PseudoSimulationsSummary,missing-method

Plot summaries of the pseudo simulations
plot,Samples,ModelEff-method

Plot the fitted dose-effcacy curve using a model from ModelEff class with samples
plot,PseudoDualSimulationsSummary,missing-method

Plot the summary of Pseudo Dual Simulations summary
size

Determine the size of the next cohort
update,DataParts-method

Update method for the "DataParts" class
update,DataDual-method

Update method for the "DataDual" class
show,SimulationsSummary-method

Show the summary of the simulations
show,PseudoSimulationsSummary-method

Show the summary of the simulations
summary,PseudoSimulations-method

Summarize the simulations, relative to a given truth
summary,PseudoDualSimulations-method

Summary for Pseudo Dual responses simulations, relative to a given pseudo DLE and efficacy model (except the EffFlexi class model)
show,GeneralSimulationsSummary-method

Show the summary of the simulations
update,EffFlexi-method

Update method for the 'EffFlexi' Model class. This is a method to update estimates both for the flexible form model and the random walk model (see details in EffFlexi class object) when new data or new observations of responses are available and added in.
plot,Samples,ModelTox-method

Plot the fitted dose-DLE curve using a ModelTox class model with samples
writeModel

Creating a WinBUGS model file
simulate,DualResponsesDesign-method

This is a methods to simulate dose escalation procedure using both DLE and efficacy responses. This is a method based on the DualResponsesDesign where DLEmodel used are of ModelTox class object and efficacy model used are of ModelEff class object. In addition, no DLE and efficacy samples are involved or generated in the simulation process
update,LogisticIndepBeta-method

Update method for the 'LogisticIndepBeta'Model class. This is a method to update the modal estimates of the model parameters \(\phi_1\) (phi1) and \(\phi_2\) (phi2) when new data or new observations of responses are available and added in.
update,Effloglog-method

Update method for the 'Effloglog' Model class. This is a method to update the modal estimates of the model parameters \(\theta_1\) (theta1), \(\theta_2\) (theta2) and \(\nu\) (nu, the precision of the efficacy responses) when new data or new observations of responses are available and added in.
summary,Simulations-method

Summarize the model-based design simulations, relative to a given truth
update,Data-method

Update method for the "Data" class
simulate,DualResponsesSamplesDesign-method

This is a methods to simulate dose escalation procedure using both DLE and efficacy responses. This is a method based on the DualResponsesSamplesDesign where DLEmodel used are of ModelTox class object and efficacy model used are of ModelEff class object (special case is EffFlexi class model object). In addition, DLE and efficacy samples are involved or generated in the simulation process
simulate,DualDesign-method

Simulate outcomes from a dual-endpoint design
simulate,Design-method

Simulate outcomes from a CRM design
show,PseudoDualSimulationsSummary-method

Show the summary of Pseudo Dual simulations summary
summary,GeneralSimulations-method

Summarize the simulations, relative to a given truth
summary,PseudoDualFlexiSimulations-method

Summary for Pseudo Dual responses simulations given a pseudo DLE model and the Flexible efficacy model.
stopTrial

Stop the trial?
summary,DualSimulations-method

Summarize the dual-endpoint design simulations, relative to given true dose-toxicity and dose-biomarker curves
CohortSizeConst-class

Constant cohort size
CohortSizeDLT

Initialization function for "CohortSizeDLT"
CohortSizeDLT-class

Cohort size based on number of DLTs
AllModels-class

Class for All models This is a class where all models inherit.
CohortSizeMax-class

Size based on maximum of multiple cohort size rules
CohortSizeMin-class

Size based on minimum of multiple cohort size rules
CohortSizeConst

Initialization function for "CohortSizeConst"
CohortSize-class

The virtual class for cohort sizes
CohortSizeMin

Initialization function for "CohortSizeMin"
CohortSizeMax

Initialization function for "CohortSizeMax"