Title: | Implementing EFF-TOX and Monotone Utility Based Phase 12 Trials |
---|---|
Description: | Contains functions for simulating phase 12 trial designs described by Chapple and Thall (2019) including simulation and the EFF-TOX trial and simulation and implementation of the U12 trial. Functions for implementing the EFF-TOX trial are found in the package 'Phase123'. |
Authors: | Andrew G Chapple |
Maintainer: | Andrew G Chapple <[email protected]> |
License: | GPL-2 |
Version: | 1.0 |
Built: | 2024-11-20 06:44:27 UTC |
Source: | CRAN |
Takes estimated posterior mean efficacy and toxicity values and returns the posterior mean desireability score for a given tradeoff contour.
GetDesire(PE, PT, Contour)
GetDesire(PE, PT, Contour)
PE |
True or estimated probability of efficacy. |
PT |
True of estimated probability of toxicity. |
Contour |
Vector containing 4 entries used to make the desireability function. Contour(1) contains a desired toxicity probability given efficacy, Countour(2) contains a desired efficacy probability given toxicity, and (Contour(3),Contour(4)) is an equally desireable pair of efficacy and toxicity probabilities that are non zero or one. |
PE=.6 PT=.2 ##Contour values Contour=c(.35,.7,.8,.6) GetDesire(PE,PT,Contour)
PE=.6 PT=.2 ##Contour values Contour=c(.35,.7,.8,.6) GetDesire(PE,PT,Contour)
Gives the dose to assign the next patient cohort using the monotone utility based phase 12 trial using either adaptive randomization or fixed dose assignment. If the trial has been completed, AR equals FALSE will give the optimal dose level for the trial.
GetOptimalUT(YE, YT, Doses, DoseTried, AR, UT, CutE, CutT, AcceptE, AcceptT, HypermeansE, HypermeansT, Hypervars)
GetOptimalUT(YE, YT, Doses, DoseTried, AR, UT, CutE, CutT, AcceptE, AcceptT, HypermeansE, HypermeansT, Hypervars)
YE |
Vector of patient efficacy status. |
YT |
Vector of patient toxicity status. |
Doses |
Vector of patient dose assignment. |
DoseTried |
Vector containing 1s for doses tried and 0 otherwise. |
AR |
Logical stating whether or not to adaptively randomize the next cohort of patients. If the trial has been completed, AR equals FALSE will give the optimal dose level for the trial. |
UT |
Utility Matrix with entries U11, U22 elicited and U12 equals 100, U21 equals 0. |
CutE |
Cutoff for efficacy acceptability. |
CutT |
Cutoff for toxicity acceptability. |
AcceptE |
Probability threshold for efficacy acceptability. |
AcceptT |
Probability threshold for toxicity acceptability. |
HypermeansE |
Dose-specific hypermeans for efficacy. |
HypermeansT |
Dose-specific hypermeans for toxcity. |
Hypervars |
Length 3 vector of hypervariances. Hypervars[1] contains the Latent parameter variance for normal probability of efficacy and toxicity. Hypervars[2] contains the hypervariance on dose specific mean efficacy and toxicity parameters and Hypervars[3] contains the frailty variance parameter. |
A numerical value of the dose to assign the next patient cohort to. If the trial has been completed, this is the optimal dose. If a value of 0 is returned, no doses are acceptable and the trial should be stopped.
library(mvtnorm) ##Data Here YE=rbinom(30,1,.8) YT=rbinom(30,1,.3) Doses=sample(1:3,30,replace=TRUE) DoseTried=c(1,1,1,0,0) ##UTILITIES UT = matrix(c(38.23529,100,0,61.76471),nrow=2,byrow=TRUE) ##Safety Parameters CutE=.3 CutT=.4 AcceptE=.1 AcceptT=.1 ##Hyperparameters for Utility HypermeansE=c(-1.189, -0.357, 0.360, 0.546, 0.743) HypermeansT=c(-2.325, -1.811, -1.464, -1.189, -0.740) Hypervars=c(1,36,1) ##Adaptively randomize or not? AR=FALSE GetOptimalUT( YE,YT, Doses,DoseTried,AR, UT, CutE, CutT, AcceptE, AcceptT, HypermeansE, HypermeansT,Hypervars)
library(mvtnorm) ##Data Here YE=rbinom(30,1,.8) YT=rbinom(30,1,.3) Doses=sample(1:3,30,replace=TRUE) DoseTried=c(1,1,1,0,0) ##UTILITIES UT = matrix(c(38.23529,100,0,61.76471),nrow=2,byrow=TRUE) ##Safety Parameters CutE=.3 CutT=.4 AcceptE=.1 AcceptT=.1 ##Hyperparameters for Utility HypermeansE=c(-1.189, -0.357, 0.360, 0.546, 0.743) HypermeansT=c(-2.325, -1.811, -1.464, -1.189, -0.740) Hypervars=c(1,36,1) ##Adaptively randomize or not? AR=FALSE GetOptimalUT( YE,YT, Doses,DoseTried,AR, UT, CutE, CutT, AcceptE, AcceptT, HypermeansE, HypermeansT,Hypervars)
Uses elicited efficacy and toxicity dose-specific parameters along with latent prior variance, dose-specific mean hypervariance and frailty variance to determine dose-specific prior means for efficacy and toxicity and prints the prior effective sample size associated with the specified prior parameters.
GetPriors(PROBST, PROBSE, Var, HypVar, tau, B)
GetPriors(PROBST, PROBSE, Var, HypVar, tau, B)
PROBST |
Elicited prior toxicity probability at each dose. |
PROBSE |
Elicted prior efficacy probability at each dose. |
Var |
Latent parameter variance for normal probability of efficacy and toxicity. |
HypVar |
Hypervariance on dose specific mean efficacy and toxicity parameters. |
tau |
Frailty variance parameter. |
B |
Number of prior samples to draw for calculating ESS. Suggested values of ten thousand. |
A list contianing the vector of dose-specific efficacy probability prior mean parameters and the vector of dose-specific toxicity probability prior mean parameters.
library(mvtnorm) PROBST=c(.05,.10,.15,.20,.30) PROBSE=c(.2,.4,.6,.65,.7) Var=1 HypVar=36 tau=1 B=100 Z=GetPriors(PROBST,PROBSE,Var,HypVar,tau,B)
library(mvtnorm) PROBST=c(.05,.10,.15,.20,.30) PROBSE=c(.2,.4,.6,.65,.7) Var=1 HypVar=36 tau=1 B=100 Z=GetPriors(PROBST,PROBSE,Var,HypVar,tau,B)
Simulates trial replications from the EFF-TOX phase 12 trial trial using either adaptive randomization or fixed dose assignment. Prints the true utility scores, dose selection probability, average number of patients treated at each dose, average number of responses, average number of toxicities, and Delta value. Returns trial outcomes.
RunAdaptiveEFFTOX(NSims, Dose, PE, PT, corET, Nmax, cohort, NF, Contour, CutE, CutT, AcceptE, AcceptT, HypermeansEFF, HypervarsEFF)
RunAdaptiveEFFTOX(NSims, Dose, PE, PT, corET, Nmax, cohort, NF, Contour, CutE, CutT, AcceptE, AcceptT, HypermeansEFF, HypervarsEFF)
NSims |
Number of simulations. |
Dose |
Log-standardized doses (log(Raw Dose)-mean(log(Raw Dose))). |
PE |
True Efficacy Probability for each dose. |
PT |
True toxicity probaiblity for each dose. |
corET |
Correlation parameter between Efficacy and Toxicity status. |
Nmax |
Maximum Sample size. |
cohort |
Cohort Size. |
NF |
Number of fixed assignment patients until adaptive randomization. If NF equals Nmax, the trial is conducted without adaptive randomization. |
Contour |
Vector containing 4 entries used to make the desireability function. Contour(1) contains a desired toxicity probability given efficacy, Countour(2) contains a desired efficacy probability given toxicity, and (Contour(3),Contour(4)) is an equally desireable pair of efficacy and toxicity probabilities that are non zero or one. |
CutE |
Cutoff for efficacy acceptability. |
CutT |
Cutoff for toxicity acceptability. |
AcceptE |
Probability threshold for efficacy acceptability. |
AcceptT |
Probability threshold for toxicity acceptability. |
HypermeansEFF |
Vector containing prior hypermeans of length 6 for EFF-TOX parameters |
HypervarsEFF |
Vector containing prior hypervariances of length 6 for EFF-TOX parameters |
A list of size NSims with results from each simulated trial. Each entry contains a list with (1) the optimal dose selected, (2) the posterior mean utility for each dose level, (3) a matrix containing the dose given, the efficacy outcome and the toxicity outcome for each patient.
Thall, P.F. and Cook, J.D. (2004). Dose-finding based on efficacy-toxicity trade-offs. Biometrics 60, 684-693.
Chapple AG, Thall PF. A Hybrid Phase 123 Clinical Trial Design Allowing Dose Re-optimization in Phase III. Biometrics. Epub ahead of print 26 October 2018.
##Trial PArameters here Nmax=30 ##Number of patients to enroll NF=30 ##Number until AR if NF=Nmax, there's no AR. cohort=3 #' Raw Dose Values Dose = c(1,2,3,3.5,5) Dose=log(Dose)-mean(log(Dose)) ## Contour Vector Contour = c(.35, .75,.7,.4) #Starting Dose DoseStart=1 ##Safety Parameters CutE=.3 CutT=.4 AcceptE=.1 AcceptT=.1 ##Hypermeans HypermeansEFF = c(.022,3.45,0,-4.23,3.1,0) ##Hypervariances HypervarsEFF = c(2.6761, 2.6852, .2, 3.1304, 3.1165, 1) HypervarsEFF=HypervarsEFF^2 #True Efficacy and Toxicity probabilities PE=c(.2,.4,.6,.7,.7) PT=c(.2,.2,.2,.3,.5) corET=0 ##Number of simulations NSims=2 RESULTS=RunAdaptiveEFFTOX(NSims,Dose,PE, PT, corET, Nmax, cohort, NF, Contour, CutE, CutT, AcceptE, AcceptT, HypermeansEFF, HypervarsEFF )
##Trial PArameters here Nmax=30 ##Number of patients to enroll NF=30 ##Number until AR if NF=Nmax, there's no AR. cohort=3 #' Raw Dose Values Dose = c(1,2,3,3.5,5) Dose=log(Dose)-mean(log(Dose)) ## Contour Vector Contour = c(.35, .75,.7,.4) #Starting Dose DoseStart=1 ##Safety Parameters CutE=.3 CutT=.4 AcceptE=.1 AcceptT=.1 ##Hypermeans HypermeansEFF = c(.022,3.45,0,-4.23,3.1,0) ##Hypervariances HypervarsEFF = c(2.6761, 2.6852, .2, 3.1304, 3.1165, 1) HypervarsEFF=HypervarsEFF^2 #True Efficacy and Toxicity probabilities PE=c(.2,.4,.6,.7,.7) PT=c(.2,.2,.2,.3,.5) corET=0 ##Number of simulations NSims=2 RESULTS=RunAdaptiveEFFTOX(NSims,Dose,PE, PT, corET, Nmax, cohort, NF, Contour, CutE, CutT, AcceptE, AcceptT, HypermeansEFF, HypervarsEFF )
Simulates trial replications from the monotone utility based phase 12 trial using either adaptive randomization or fixed dose assignment. Prints the true utility scores, dose selection probability, average number of patients treated at each dose, average number of responses, average number of toxicities, and Delta value. Returns trial outcomes.
RunAdaptiveUT(NSims, PE, PT, corET, Nmax, cohort, NF, UT, CutE, CutT, AcceptE, AcceptT, HypermeansE, HypermeansT, Hypervars)
RunAdaptiveUT(NSims, PE, PT, corET, Nmax, cohort, NF, UT, CutE, CutT, AcceptE, AcceptT, HypermeansE, HypermeansT, Hypervars)
NSims |
Number of simulations. |
PE |
True Efficacy Probability for each dose. |
PT |
True toxicity probaiblity for each dose. |
corET |
Correlation parameter between Efficacy and Toxicity status. |
Nmax |
Maximum Sample size. |
cohort |
Cohort Size. |
NF |
Number of fixed assignment patients until adaptive randomization. If NF equals Nmax, the trial is conducted without adaptive randomization. |
UT |
Utility Matrix with entries U11, U22 elicited and U12 equals 100, U21 equals 0. |
CutE |
Cutoff for efficacy acceptability. |
CutT |
Cutoff for toxicity acceptability. |
AcceptE |
Probability threshold for efficacy acceptability. |
AcceptT |
Probability threshold for toxicity acceptability. |
HypermeansE |
Dose-specific hypermeans for efficacy. |
HypermeansT |
Dose-specific hypermeans for toxcity. |
Hypervars |
Length 3 vector of hypervariances. Hypervars[1] contains the Latent parameter variance for normal probability of efficacy and toxicity. Hypervars[2] contains the hypervariance on dose specific mean efficacy and toxicity parameters and Hypervars[3] contains the frailty variance parameter. |
A list of size NSims with results from each simulated trial. Each entry contains a list with (1) the optimal dose selected, (2) the posterior mean utility for each dose level, (3) a matrix containing the dose given, the efficacy outcome and the toxicity outcome for each patient.
library(bindata) library(mvtnorm) ##Trial PArameters here Nmax=30 ##Number of patients to enroll NF=30 ##Number until AR if NF=Nmax, there's no AR. cohort=3 ##UTILITIES UT = matrix(c(38.23529,100,0,61.76471),nrow=2,byrow=TRUE) ##Safety Parameters CutE=.3 CutT=.4 AcceptE=.1 AcceptT=.1 ##Hyperparameters for Utility HypermeansE=c(-1.189, -0.357, 0.360, 0.546, 0.743) HypermeansT=c(-2.325, -1.811, -1.464, -1.189, -0.740) Hypervars=c(1,36,1) #True Efficacy and Toxicity probabilities PE=c(.2,.4,.6,.7,.7) PT=c(.2,.2,.2,.3,.5) corET=0 ##Number of simulations NSims=2 RESULTS=RunAdaptiveUT(NSims, PE, PT, corET, Nmax, cohort,NF, UT, CutE, CutT, AcceptE, AcceptT, HypermeansE, HypermeansT, Hypervars)
library(bindata) library(mvtnorm) ##Trial PArameters here Nmax=30 ##Number of patients to enroll NF=30 ##Number until AR if NF=Nmax, there's no AR. cohort=3 ##UTILITIES UT = matrix(c(38.23529,100,0,61.76471),nrow=2,byrow=TRUE) ##Safety Parameters CutE=.3 CutT=.4 AcceptE=.1 AcceptT=.1 ##Hyperparameters for Utility HypermeansE=c(-1.189, -0.357, 0.360, 0.546, 0.743) HypermeansT=c(-2.325, -1.811, -1.464, -1.189, -0.740) Hypervars=c(1,36,1) #True Efficacy and Toxicity probabilities PE=c(.2,.4,.6,.7,.7) PT=c(.2,.2,.2,.3,.5) corET=0 ##Number of simulations NSims=2 RESULTS=RunAdaptiveUT(NSims, PE, PT, corET, Nmax, cohort,NF, UT, CutE, CutT, AcceptE, AcceptT, HypermeansE, HypermeansT, Hypervars)
Takes arguments of data, hypermens and hypervariance vectors and returns a list of posterior samples from the Utility based phase12 model decribed by Chapple and Thall (2019).
UTEFFTOX(YE, YT, Doses, HypermeansEFF, HypermeansTOX, Hypervars, B)
UTEFFTOX(YE, YT, Doses, HypermeansEFF, HypermeansTOX, Hypervars, B)
YE |
Binary indicator vector of efficacy status. |
YT |
Binary indicator vector of toxicity status. |
Doses |
Vector of integer Doses given to patients. |
HypermeansEFF |
Vector of length nDose for dose prior means for efficacy. |
HypermeansTOX |
Vector of length nDose for dose prior means for toxicity |
Hypervars |
Length 5 vector of hypervariances. Hypervars(1) and Hypervars(2) contains the Latent parameter variance for normal probability of efficacy and toxicity. Hypervars(3) and Hypervars(4) contains the hypervariance on dose specific mean efficacy and toxicity parameters and Hypervars(5) contains the frailty variance parameter. |
B |
Number of iterations to run for the MCMC. |
A list of posterior samples after burnin in order: Posterior efficacy dose-vector, Posterior toxicity dose-vector, Posterior correlation.
n=100 #Generate Data YE=rbinom(n,1,.6) YT=rbinom(n,1,.2) nDose=5 Doses=sample(1:nDose,n,replace=TRUE) ##Hyperparameters HypermeansEFF=c(-1,-.5,0,.5,1,2) HypermeansTOX=HypermeansEFF Hypervars=c(1,1,36,36,1) B=100 UTEFFTOX(YE, YT,Doses,HypermeansEFF,HypermeansTOX, Hypervars, B)
n=100 #Generate Data YE=rbinom(n,1,.6) YT=rbinom(n,1,.2) nDose=5 Doses=sample(1:nDose,n,replace=TRUE) ##Hyperparameters HypermeansEFF=c(-1,-.5,0,.5,1,2) HypermeansTOX=HypermeansEFF Hypervars=c(1,1,36,36,1) B=100 UTEFFTOX(YE, YT,Doses,HypermeansEFF,HypermeansTOX, Hypervars, B)