GetEfftoxUt {Phase12Compare} | R Documentation |
Assigns next patient cohort based on the Efftox model with a Utility based objective function.
Description
Provides the optimal dose level as determined by the Efftox model, posterior mean toxicity probability, efficacy probability, and mean utility of each dose level. Doses that are unacceptably toxic or inefficous have a utility of 0.
Usage
GetEfftoxUt(
YE,
YT,
Doses,
Dose,
Dosetried,
cohort,
UT,
CutE,
CutT,
AcceptE,
AcceptT,
HypermeansEFF,
HypervarsEFF,
B
)
Arguments
YE |
Length n binary indicator vector of efficacy status. |
YT |
Length n binary indicator vector of toxicity status. |
Doses |
Length n vector of integer Doses given to patients. |
Dose |
Vector of standardized log-dose levels considered in the trial. |
Dosetried |
Binary vector corresponding to which doses have been tried. |
cohort |
Cohort size for the trial. |
UT |
Utility matrix for the four bivariate (efficacy, toxicity) events. |
CutE |
Cutoff for efficacy probability acceptability. Dose-efficacy probabilities must be larger than this for patient assignment. |
CutT |
Cutoff for toxicity probability acceptability. Dose-toxicity probabilities must be smaller than this for patient assignment. |
AcceptE |
Posterior probability threshold for efficacy acceptability. |
AcceptT |
Posterior probability threshold for toxicity acceptability. |
HypermeansEFF |
Hypermeans for the Efftox model. In order, entries are hypermeans for (beta_0,E,beta_1,E,beta_2,E,beta_0,T,beta_1,T,psi). |
HypervarsEFF |
Hypervariances for the Efftox model. In order, entries are hypervariances for (beta_0,E,beta_1,E,beta_2,E,beta_0,T,beta_1,T,psi). |
B |
Number of iterations to run for the MCMC. |
Value
A list containing the optimal dose level to assign the next patient cohort in the first entry and a matrix in the second entry, with rows corresponding to (1) the dose #, (2) mean posterior toxicity probability at each dose, mean posterior efficacy probability at each dose, and acceptable posterior utility score of each dose level (0s indicate the dose is not acceptably efficous or toxic).
Examples
##Get the Data
##True Tox Prob
PT = c(.1,.2,.25,.5,.7)
##True EFF Prob
PE = c(.3,.4,.7,.5,.5)
Doses=c(1,1,1,2,2,2,3,3,3,2,2,2,1,1,1,2,2,2,3,3,3)
YE=Doses
YT=Doses
Dosetried=rep(0,length(PE))
##Generate data
for(k in 1:length(PE)){
if(sum(Doses==k)){
##Dose level has been tried
Dosetried[k]=1
YE[Doses==k]=rbinom(sum(Doses==k),1,PE[k])
YT[Doses==k]=rbinom(sum(Doses==k),1,PT[k])
}
}
##Hypermeans and hypervariances
HypermeansEFF = c(.022,3.45,0,-4.23,3.1,0)
HypervarsEFF = c(2.6761, 2.6852, .2, 3.1304, 3.1165, 1)
HypervarsEFF=HypervarsEFF^2
##Vector of Numerical Doses
Dose = c(1,2,3,3.5,5)
##Dose for Eff-Tox
Dose=log(Dose)-mean(log(Dose))
##Trial parameters
cohort=3
##Utility Matrix
UT = matrix(c(38.23529,100,0,61.76471),nrow=2,byrow=TRUE)
CutE=.3 ##Efficacy threshold
CutT=.4 ##Toxicity threshold
AcceptE=.3 ##Eff acceptability threshold
AcceptT= .3 ##Tox acceptability threshold
B=100##Number of iterations
GetEfftoxUt(YE, YT,Doses,Dose, Dosetried,
cohort, UT,CutE, CutT, AcceptE, AcceptT,
HypermeansEFF, HypervarsEFF,B )