GetSpsoUt: Assigns next patient cohort based on the SPSOP model with a...

Description Usage Arguments Value Examples

View source: R/GetSpsoUt.R

Description

Provides the optimal dose level as determined by the SPSO 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
GetSpsoUt(
  YE,
  YT,
  Doses,
  Dosetried,
  cohort,
  UT,
  CutE,
  CutT,
  AcceptE,
  AcceptT,
  HypermeansE,
  HypermeansT,
  Hypervars,
  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.

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.

HypermeansE

Hypermeans for dose-specific efficacy parameters.

HypermeansT

Hypermeans for dose-specific toxcity parameters.

Hypervars

Hypervariances needed for the SPSO model. Contains, in order (sigma_0^2, sigma_mu^2,tau).

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

 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
##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])
}
}
##Hyperparameters
HypermeansE=c(-1,-.5,0,.5,1,2)
HypermeansT=HypermeansE
Hypervars=c(1,16,1)
##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
GetSpsoUt(YE,YT,Doses,Dosetried,cohort,UT,CutE, CutT, AcceptE, AcceptT,
HypermeansE,  HypermeansT,Hypervars,B )

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