Last data update: 2014.03.03

R: Bayesian, single arm, two endpoint trial design, using...
print.list_trialDesign_binom_twoR Documentation

Bayesian, single arm, two endpoint trial design, using posterior probability to make decisions.

Description

This class is used to compare designs and methodologies frequentist and bayesian properties. To use it create a list of trial designs of class trialDesign_binom_two and assign the class as list_trialDesign_binom_two (class(x)=c("list_trialDesign_binom_two",class(x))).

Usage

## S3 method for class 'list_trialDesign_binom_two'
print(x, ...)

Arguments

x

A list of the S4 class object bayes_binom_two_postprob

...

Standard arguments to pass to print

See Also

bayes_binom_two_postprob, bayes_binom_two_postlike,bayes_binom_two_loss,freq_binom_two_bryantday_twostage

Examples

## Frequentist simulations
# modelled toxicity probability
t=c(0.1,0.3,0.1,0.3)
# modelled response probability
r=c(0.35,0.2,0.2,0.35)

## Bayesian uniform prior
pra=1;prb=1;pta=1;ptb=1
## bayesian cutoffs
futility_critical_value=0.35
efficacy_critical_value=0.2
toxicity_critical_value=0.1
no_toxicity_critical_value=0.3

###############################################################
# Frequentist methods
###############################################################
# Single stage

r1=0.35
r0=0.2
t0=0.3
t1=0.1

power=0.8
alpha=0.1

nmax=50
out_single=freq_binom_two_singlestage(r0,r1,t0,t1,power,alpha,nmax,
	adjust=TRUE)

single_stage=properties(out_single,t,r,pra,prb,pta,ptb,
	futility_critical_value,efficacy_critical_value,
	toxicity_critical_value,no_toxicity_critical_value)

print(single_stage)

###############################################################
# Bayesian posterior probability approach


# analysis at
reviews=c(44)
# Stopping rules at each analysis
futility_prob_stop=0.9
efficacy_prob_stop=0.9
toxicity_prob_stop=0.9
no_toxicity_prob_stop=0.9

bayes_prob_single=bayes_binom_two_postprob(t,r,reviews,pra,prb,pta,
	ptb,futility_critical_value,futility_prob_stop,
	efficacy_critical_value,efficacy_prob_stop,
	toxicity_critical_value,toxicity_prob_stop,
	no_toxicity_critical_value,no_toxicity_prob_stop)

bayes_prob_single


# analysis at
reviews=c(10,17,24,30,37,44)
# Stopping rules at each analysis
futility_prob_stop=c(0.95,0.95,0.95,0.95,0.95,0.9)
efficacy_prob_stop=c(1,1,0.95,0.95,0.95,0.9)
toxicity_prob_stop=c(0.95,0.95,0.95,0.95,0.95,0.9)
no_toxicity_prob_stop=c(1,1,0.95,0.95,0.95,0.9)

bayes_prob_six=bayes_binom_two_postprob(t,r,reviews,pra,prb,pta,
	ptb,futility_critical_value,futility_prob_stop,
	efficacy_critical_value,efficacy_prob_stop,
	toxicity_critical_value,toxicity_prob_stop,
	no_toxicity_critical_value,no_toxicity_prob_stop)

plot(bayes_prob_six)


###############################################################
# Bayesian posterior likelihood approach
###############################################################
reviews=c(11,17,24,30,37,44)

efficacy_prob_stop=0.9
toxicity_prob_stop=0.9

# interim required probability to stop
int_combined_prob=0.95
int_futility_prob=1
int_toxicity_prob=1
int_efficacy_prob=0.95

bayes_like_six=bayes_binom_two_postlike(t,r,reviews,pra,prb,pta,
	ptb,efficacy_critical_value,efficacy_prob_stop,
	toxicity_critical_value,toxicity_prob_stop,int_combined_prob,
	int_futility_prob,int_toxicity_prob,int_efficacy_prob,
	futility_critical_value,no_toxicity_critical_value)

plot(bayes_like_six)

###############################################################
## Table of all designs
###############################################################
tble=list(single_stage=single_stage,bayes_prob_single=bayes_prob_single,
	bayes_prob_six=bayes_prob_six,bayes_like_six=bayes_like_six)

class(tble)=c("list_trialDesign_binom_two",class(tble))
tble
###############################################################

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(EurosarcBayes)
Loading required package: shiny
Loading required package: VGAM
Loading required package: stats4
Loading required package: splines
Loading required package: data.table
Loading required package: plyr
Loading required package: clinfun
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/EurosarcBayes/print.list_trialDesign_binom_two.Rd_%03d_medium.png", width=480, height=480)
> ### Name: print.list_trialDesign_binom_two
> ### Title: Bayesian, single arm, two endpoint trial design, using posterior
> ###   probability to make decisions.
> ### Aliases: print.list_trialDesign_binom_two list_trialDesign_binom_two
> 
> ### ** Examples
> 
> ## Frequentist simulations
> # modelled toxicity probability
> t=c(0.1,0.3,0.1,0.3)
> # modelled response probability
> r=c(0.35,0.2,0.2,0.35)
> 
> ## Bayesian uniform prior
> pra=1;prb=1;pta=1;ptb=1
> ## bayesian cutoffs
> futility_critical_value=0.35
> efficacy_critical_value=0.2
> toxicity_critical_value=0.1
> no_toxicity_critical_value=0.3
> 
> ###############################################################
> # Frequentist methods
> ###############################################################
> # Single stage
> 
> r1=0.35
> r0=0.2
> t0=0.3
> t1=0.1
> 
> power=0.8
> alpha=0.1
> 
> nmax=50
> out_single=freq_binom_two_singlestage(r0,r1,t0,t1,power,alpha,nmax,
+ 	adjust=TRUE)
> 
> single_stage=properties(out_single,t,r,pra,prb,pta,ptb,
+ 	futility_critical_value,efficacy_critical_value,
+ 	toxicity_critical_value,no_toxicity_critical_value)
cut-points at each analysis
  patient review low toxicity high toxicity poor outcome good outcome
1             44            9            10           12           13

Frequentist properties of design
                                  Stopping rules T=0.1, R=0.35 T=0.3, R=0.2
1                 Stop early - Futility/Toxicity          0.00         0.00
4 Continue to final analysis - Futility/Toxicity         18.88        99.06
2                          Stop early - Efficacy          0.00         0.00
3          Continue to final analysis - Efficacy         81.12         0.94
6          Expected number of patients recruited         44.00        44.00
  T=0.1, R=0.2 T=0.3, R=0.35
1         0.00          0.00
4        91.51         91.05
2         0.00          0.00
3         8.49          8.95
6        44.00         44.00

Bayesian properties of trial design
  n T>0.3 T>0.1 T>0.3 T>0.1 R>0.2 R>0.35 R>0.2 R>0.35
 44 0.093 0.988 0.165 0.996 0.901  0.155 0.948  0.244

Futility     P(R<0.35)=0.845
Efficacy     P(R>0.2)=0.948

Toxicity ok  P(T<0.3)=0.907
Toxicity     P(T>0.1)=0.996> 
> print(single_stage)
  n  alpha   beta Exp.P0 Exp.P1 post.futility post.efficacy post.toxicity
 44 0.0895 0.1888     44     44         0.845         0.948         0.996
 post.no_toxicity
            0.907
> 
> ###############################################################
> # Bayesian posterior probability approach
> 
> 
> # analysis at
> reviews=c(44)
> # Stopping rules at each analysis
> futility_prob_stop=0.9
> efficacy_prob_stop=0.9
> toxicity_prob_stop=0.9
> no_toxicity_prob_stop=0.9
> 
> bayes_prob_single=bayes_binom_two_postprob(t,r,reviews,pra,prb,pta,
+ 	ptb,futility_critical_value,futility_prob_stop,
+ 	efficacy_critical_value,efficacy_prob_stop,
+ 	toxicity_critical_value,toxicity_prob_stop,
+ 	no_toxicity_critical_value,no_toxicity_prob_stop)
cut-points at each analysis
  patient review low toxicity high toxicity poor outcome good outcome
1             44            9            10           11           12

Frequentist properties of design
                                  Stopping rules T=0.1, R=0.35 T=0.3, R=0.2
1                 Stop early - Futility/Toxicity          0.00         0.00
4 Continue to final analysis - Futility/Toxicity         11.61        98.32
2                          Stop early - Efficacy          0.00         0.00
3          Continue to final analysis - Efficacy         88.39         1.68
6          Expected number of patients recruited         44.00        44.00
  T=0.1, R=0.2 T=0.3, R=0.35
1         0.00          0.00
4        84.74         90.25
2         0.00          0.00
3        15.26          9.75
6        44.00         44.00

Bayesian properties of trial design
  n T>0.3 T>0.1 T>0.3 T>0.1 R>0.2 R>0.35 R>0.2 R>0.35
 44 0.093 0.988 0.165 0.996 0.826   0.09 0.901  0.155

Futility     P(R<0.35)=0.91
Efficacy     P(R>0.2)=0.901

Toxicity ok  P(T<0.3)=0.907
Toxicity     P(T>0.1)=0.996> 
> bayes_prob_single
  n  alpha   beta Exp.P0 Exp.P1 post.futility post.efficacy post.toxicity
 44 0.1526 0.1161     44     44          0.91         0.901         0.996
 post.no_toxicity
            0.907
> 
> 
> # analysis at
> reviews=c(10,17,24,30,37,44)
> # Stopping rules at each analysis
> futility_prob_stop=c(0.95,0.95,0.95,0.95,0.95,0.9)
> efficacy_prob_stop=c(1,1,0.95,0.95,0.95,0.9)
> toxicity_prob_stop=c(0.95,0.95,0.95,0.95,0.95,0.9)
> no_toxicity_prob_stop=c(1,1,0.95,0.95,0.95,0.9)
> 
> bayes_prob_six=bayes_binom_two_postprob(t,r,reviews,pra,prb,pta,
+ 	ptb,futility_critical_value,futility_prob_stop,
+ 	efficacy_critical_value,efficacy_prob_stop,
+ 	toxicity_critical_value,toxicity_prob_stop,
+ 	no_toxicity_critical_value,no_toxicity_prob_stop)
cut-points at each analysis
  patient review low toxicity high toxicity poor outcome good outcome
1             10           NA             3            0           NA
2             17           NA             4            2           NA
3             24            3             5            4            8
4             30            4             6            6           10
5             37            6             7            8           12
6             44            9            10           11           12

Frequentist properties of design
                                  Stopping rules T=0.1, R=0.35 T=0.3, R=0.2
1                 Stop early - Futility/Toxicity         24.07        99.02
4 Continue to final analysis - Futility/Toxicity          2.73         0.31
2                          Stop early - Efficacy         64.32         0.52
3          Continue to final analysis - Efficacy          8.88         0.16
6          Expected number of patients recruited         26.46        13.62
  T=0.1, R=0.2 T=0.3, R=0.35
1        77.92         95.90
4         8.44          0.09
2         9.10          3.78
3         4.54          0.23
6        24.62         14.36

Bayesian properties of trial design
  n T>0.3 T>0.1 T>0.3 T>0.1 R>0.2 R>0.35 R>0.2 R>0.35
 10    NA    NA 0.570 0.981 0.086  0.009    NA     NA
 17    NA    NA 0.333 0.972 0.271  0.024    NA     NA
 24 0.033 0.764 0.193 0.967 0.421  0.032 0.953  0.467
 30 0.024 0.807 0.135 0.969 0.571  0.046 0.967  0.455
 37 0.036 0.920 0.079 0.968 0.655  0.047 0.971  0.399
 44 0.093 0.988 0.165 0.996 0.826  0.090 0.901  0.155

Futility     P(R<0.35)=0.91
Efficacy     P(R>0.2)=0.901

Toxicity ok  P(T<0.3)=0.907
Toxicity     P(T>0.1)=0.967> 
> plot(bayes_prob_six)
> 
> 
> ###############################################################
> # Bayesian posterior likelihood approach
> ###############################################################
> reviews=c(11,17,24,30,37,44)
> 
> efficacy_prob_stop=0.9
> toxicity_prob_stop=0.9
> 
> # interim required probability to stop
> int_combined_prob=0.95
> int_futility_prob=1
> int_toxicity_prob=1
> int_efficacy_prob=0.95
> 
> bayes_like_six=bayes_binom_two_postlike(t,r,reviews,pra,prb,pta,
+ 	ptb,efficacy_critical_value,efficacy_prob_stop,
+ 	toxicity_critical_value,toxicity_prob_stop,int_combined_prob,
+ 	int_futility_prob,int_toxicity_prob,int_efficacy_prob,
+ 	futility_critical_value,no_toxicity_critical_value)
cut-points at each analysis
  patient review low toxicity high toxicity poor outcome good outcome
1             11            0             4            0            7
2             17            0             6            1            7
3             24            2             7            3            9
4             30            3             8            5           10
5             37            5             9            7           12
6             44            9            10           11           12

Frequentist properties of design
                                  Stopping rules T=0.1, R=0.35 T=0.3, R=0.2
1                 Stop early - Futility/Toxicity          9.98        95.64
4 Continue to final analysis - Futility/Toxicity          6.07         2.63
2                          Stop early - Efficacy         62.49         0.26
3          Continue to final analysis - Efficacy         21.45         1.47
6          Expected number of patients recruited         32.00        16.80
  T=0.1, R=0.2 T=0.3, R=0.35
1        62.59         87.45
4        22.86          4.90
2         6.57          1.83
3         7.98          5.82
6        29.53         21.03

Bayesian properties of trial design
  n T>0.3 T>0.1 T>0.3 T>0.1 R>0.2 R>0.35 R>0.2 R>0.35
 11 0.014 0.282 0.724 0.996 0.069  0.006 0.999  0.974
 17 0.002 0.150 0.722 0.999 0.099  0.005 0.984  0.728
 24 0.009 0.537 0.512 0.998 0.234  0.010 0.983  0.630
 30 0.007 0.624 0.386 0.997 0.393  0.018 0.967  0.455
 37 0.014 0.825 0.255 0.997 0.500  0.020 0.971  0.399
 44 0.093 0.988 0.165 0.996 0.826  0.090 0.901  0.155

Futility     P(R<0.35)=0.91
Efficacy     P(R>0.2)=0.901

Toxicity ok  P(T<0.3)=0.907
Toxicity     P(T>0.1)=0.996> 
> plot(bayes_like_six)
> 
> ###############################################################
> ## Table of all designs
> ###############################################################
> tble=list(single_stage=single_stage,bayes_prob_single=bayes_prob_single,
+ 	bayes_prob_six=bayes_prob_six,bayes_like_six=bayes_like_six)
> 
> class(tble)=c("list_trialDesign_binom_two",class(tble))
> tble
              name                 n  alpha   beta Exp.P0 Exp.P1 post.futility
      single_stage                44 0.0895 0.1888     44     44         0.845
 bayes_prob_single                44 0.1526 0.1161     44     44          0.91
    bayes_prob_six 10,17,24,30,37,44 0.1364  0.268  24.62  26.46          0.91
    bayes_like_six 11,17,24,30,37,44 0.1455 0.1606  29.53     32          0.91
 post.efficacy post.toxicity post.no_toxicity
         0.948         0.996            0.907
         0.901         0.996            0.907
         0.901         0.967            0.907
         0.901         0.996            0.907
> ###############################################################
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>