GetEfftoxContour: Assigns next patient cohort based on the Efftox model with a...

Description Usage Arguments Value Examples

View source: R/GetEfftoxContour.R

Description

Provides the optimal dose level as determined by the Efftox model, posterior mean toxicity probability, efficacy probability, and desirability of each dose level. Doses that are unacceptably toxic or inefficous have a desirability of 0.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
GetEfftoxContour(
  YE,
  YT,
  Doses,
  Dose,
  Dosetried,
  cohort,
  Contour,
  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.

Contour

Contour vector for desirability function. Contains in order: (pi_1,E,pi_2,T,pi_3,E,pi_4,T).

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 desirability score of each dose level (0s indicate the dose is not acceptably efficous or toxic).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
##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
##Contour vector
Contour = c(.35, .75,.7,.4)
CutE=.3 ##Efficacy threshold
CutT=.4 ##Toxicity threshold
AcceptE=.3 ##Eff acceptability threshold
AcceptT= .3 ##Tox acceptability threshold
B=100##Number of iterations
GetEfftoxContour(YE, YT,Doses,Dose, Dosetried,
cohort, Contour,CutE, CutT, AcceptE, AcceptT,
HypermeansEFF, HypervarsEFF,B )

Phase12Compare documentation built on July 31, 2020, 5:07 p.m.