Function for calculating the operating characteristics of the RCT Bayesian designs in setting 3 and 4 for early gating.

oc_rct(
  N_c,
  N_e,
  delta,
  delta_power,
  confidence,
  e_a = 0.5,
  e_b = 0.5,
  c_a = 0.5,
  c_b = 0.5,
  h_a = 0.5,
  h_b = 0.5,
  RR_h = NULL,
  N_h = NULL,
  w = NULL,
  trues = seq(0, 1, 0.01),
  plot = T,
  legend = T,
  legend.pos = "topleft"
)

Arguments

N_c

Sample Size in the control group. Can be either a single value or a vector, but needs to be the same length as N_e.

N_e

Sample Size in the experimental group. Can be either a single value or a vector, but needs to be the same length as N_c.

delta

Required superiority to make a "GO" decision. Corresponds to \(\delta\).

delta_power

Superiority, at which decision power will be evaluated. Corresponds to \(\bar{\delta}\).

confidence

Required confidence to make "GO" decision. Corresponds to \(\gamma\).

e_a

Alpha parameter of Beta Prior Distribution for the experimental response rate. Corresponds to \(\alpha_e\). Default is \(\frac{1}{2}\).

e_b

Beta parameter of Beta Prior Distribution for the experimental response rate. Corresponds to \(\beta_e\). Default is \(\frac{1}{2}\).

c_a

Alpha parameter of Beta Prior Distribution for the control response rate. Corresponds to \(\alpha_c\). Default is \(\frac{1}{2}\).

c_b

Beta parameter of Beta Prior Distribution for the control response rate. Corresponds to \(\beta_c\). Default is \(\frac{1}{2}\).

h_a

Alpha parameter of Beta Prior Distribution for the historical control response rate. Corresponds to \(\alpha_h\). Only needs to be specified, if RR_h, N_h and w are also specified. Default is \(\frac{1}{2}\).

h_b

Beta parameter of Beta Prior Distribution for the historical control response rate. Corresponds to \(\beta_h\). Only needs to be specified, if RR_h, N_h and w are also specified. Default is \(\frac{1}{2}\).

RR_h

Historical control response rate. Corresponds to \(p_h\). If specified together with N_h and w, function will use setting 4 from pdf.

N_h

Historical control sample size. Corresponds to \(n_h\). If specified together with RR_h and w, function will use setting 4 from pdf.

w

Level of dynmaic borrowing. Corresponds to \(w\).

trues

Sequence of true control response rates and experimental response rates, at which the Probability to Go will be computed. Default is seq(0,1,0.01) to ensure continuous plots and accurate results.

plot

Plots yes or no. Default is TRUE.

legend

Logical; whether or not to include legend in plot. Default is TRUE.

legend.pos

Position of legend. Default is "topleft".

Value

A matrix containing the decision power and decision alpha with respect to the true control response rate.

Examples

# Setting 3 oc_rct( N_c = 25, N_e = 25, delta = 0.08, delta_power = 0.13, confidence = 0.6 )
#> Dec. Alpha Dec. Power True control RR #> [1,] 0.0000 0.4123 0.00 #> [2,] 0.0001 0.4222 0.01 #> [3,] 0.0009 0.4301 0.02 #> [4,] 0.0032 0.4364 0.03 #> [5,] 0.0071 0.4415 0.04 #> [6,] 0.0124 0.4457 0.05 #> [7,] 0.0187 0.4492 0.06 #> [8,] 0.0257 0.4521 0.07 #> [9,] 0.0330 0.4546 0.08 #> [10,] 0.0405 0.4567 0.09 #> [11,] 0.0479 0.4586 0.10 #> [12,] 0.0551 0.4602 0.11 #> [13,] 0.0621 0.4616 0.12 #> [14,] 0.0687 0.4629 0.13 #> [15,] 0.0751 0.4640 0.14 #> [16,] 0.0811 0.4650 0.15 #> [17,] 0.0868 0.4659 0.16 #> [18,] 0.0922 0.4668 0.17 #> [19,] 0.0973 0.4675 0.18 #> [20,] 0.1021 0.4682 0.19 #> [21,] 0.1067 0.4688 0.20 #> [22,] 0.1110 0.4693 0.21 #> [23,] 0.1150 0.4699 0.22 #> [24,] 0.1188 0.4703 0.23 #> [25,] 0.1223 0.4707 0.24 #> [26,] 0.1257 0.4711 0.25 #> [27,] 0.1288 0.4715 0.26 #> [28,] 0.1318 0.4718 0.27 #> [29,] 0.1345 0.4721 0.28 #> [30,] 0.1371 0.4724 0.29 #> [31,] 0.1395 0.4726 0.30 #> [32,] 0.1418 0.4728 0.31 #> [33,] 0.1439 0.4731 0.32 #> [34,] 0.1459 0.4732 0.33 #> [35,] 0.1477 0.4734 0.34 #> [36,] 0.1494 0.4735 0.35 #> [37,] 0.1510 0.4737 0.36 #> [38,] 0.1524 0.4738 0.37 #> [39,] 0.1538 0.4739 0.38 #> [40,] 0.1550 0.4739 0.39 #> [41,] 0.1561 0.4740 0.40 #> [42,] 0.1570 0.4740 0.41 #> [43,] 0.1579 0.4741 0.42 #> [44,] 0.1587 0.4741 0.43 #> [45,] 0.1593 0.4741 0.44 #> [46,] 0.1599 0.4741 0.45 #> [47,] 0.1603 0.4740 0.46 #> [48,] 0.1607 0.4740 0.47 #> [49,] 0.1609 0.4739 0.48 #> [50,] 0.1611 0.4739 0.49 #> [51,] 0.1611 0.4738 0.50 #> [52,] 0.1611 0.4737 0.51 #> [53,] 0.1609 0.4735 0.52 #> [54,] 0.1607 0.4734 0.53 #> [55,] 0.1603 0.4732 0.54 #> [56,] 0.1599 0.4731 0.55 #> [57,] 0.1593 0.4728 0.56 #> [58,] 0.1587 0.4726 0.57 #> [59,] 0.1579 0.4724 0.58 #> [60,] 0.1570 0.4721 0.59 #> [61,] 0.1561 0.4718 0.60 #> [62,] 0.1550 0.4715 0.61 #> [63,] 0.1538 0.4711 0.62 #> [64,] 0.1524 0.4707 0.63 #> [65,] 0.1510 0.4703 0.64 #> [66,] 0.1494 0.4699 0.65 #> [67,] 0.1477 0.4693 0.66 #> [68,] 0.1459 0.4688 0.67 #> [69,] 0.1439 0.4682 0.68 #> [70,] 0.1418 0.4675 0.69 #> [71,] 0.1395 0.4668 0.70 #> [72,] 0.1371 0.4659 0.71 #> [73,] 0.1345 0.4650 0.72 #> [74,] 0.1318 0.4640 0.73 #> [75,] 0.1288 0.4629 0.74 #> [76,] 0.1257 0.4616 0.75 #> [77,] 0.1223 0.4602 0.76 #> [78,] 0.1188 0.4586 0.77 #> [79,] 0.1150 0.4567 0.78 #> [80,] 0.1110 0.4546 0.79 #> [81,] 0.1067 0.4521 0.80 #> [82,] 0.1021 0.4492 0.81 #> [83,] 0.0973 0.4457 0.82 #> [84,] 0.0922 0.4415 0.83 #> [85,] 0.0868 0.4364 0.84 #> [86,] 0.0811 0.4301 0.85 #> [87,] 0.0751 0.4222 0.86 #> [88,] 0.0687 0.4123 0.87 #> [89,] 0.0621 0.0000 0.88 #> [90,] 0.0551 0.0000 0.89 #> [91,] 0.0479 0.0000 0.90 #> [92,] 0.0405 0.0000 0.91 #> [93,] 0.0330 0.0000 0.92 #> [94,] 0.0257 0.0000 0.93 #> [95,] 0.0187 0.0000 0.94 #> [96,] 0.0124 0.0000 0.95 #> [97,] 0.0071 0.0000 0.96 #> [98,] 0.0032 0.0000 0.97 #> [99,] 0.0009 0.0000 0.98 #> [100,] 0.0001 0.0000 0.99 #> [101,] 0.0000 0.0000 1.00
# Setting 4 oc_rct( N_c = 25, N_e = 25, delta = 0.08, delta_power = 0.13, confidence = 0.6, RR_h = 0.5, N_h = 50, w = 0.3 )
#> Dec. Alpha Dec. Power True control RR #> [1,] 0.0000 0.4123 0.00 #> [2,] 0.0001 0.4222 0.01 #> [3,] 0.0009 0.4300 0.02 #> [4,] 0.0032 0.4362 0.03 #> [5,] 0.0071 0.4410 0.04 #> [6,] 0.0124 0.4445 0.05 #> [7,] 0.0187 0.4466 0.06 #> [8,] 0.0257 0.4473 0.07 #> [9,] 0.0330 0.4464 0.08 #> [10,] 0.0404 0.4441 0.09 #> [11,] 0.0476 0.4402 0.10 #> [12,] 0.0545 0.4348 0.11 #> [13,] 0.0610 0.4281 0.12 #> [14,] 0.0668 0.4203 0.13 #> [15,] 0.0719 0.4116 0.14 #> [16,] 0.0763 0.4023 0.15 #> [17,] 0.0798 0.3926 0.16 #> [18,] 0.0826 0.3827 0.17 #> [19,] 0.0844 0.3727 0.18 #> [20,] 0.0856 0.3628 0.19 #> [21,] 0.0860 0.3531 0.20 #> [22,] 0.0859 0.3437 0.21 #> [23,] 0.0852 0.3346 0.22 #> [24,] 0.0842 0.3259 0.23 #> [25,] 0.0829 0.3177 0.24 #> [26,] 0.0813 0.3101 0.25 #> [27,] 0.0796 0.3030 0.26 #> [28,] 0.0778 0.2966 0.27 #> [29,] 0.0759 0.2909 0.28 #> [30,] 0.0740 0.2860 0.29 #> [31,] 0.0722 0.2819 0.30 #> [32,] 0.0704 0.2786 0.31 #> [33,] 0.0688 0.2762 0.32 #> [34,] 0.0672 0.2748 0.33 #> [35,] 0.0659 0.2742 0.34 #> [36,] 0.0647 0.2747 0.35 #> [37,] 0.0637 0.2762 0.36 #> [38,] 0.0630 0.2787 0.37 #> [39,] 0.0625 0.2824 0.38 #> [40,] 0.0624 0.2872 0.39 #> [41,] 0.0626 0.2933 0.40 #> [42,] 0.0631 0.3007 0.41 #> [43,] 0.0640 0.3095 0.42 #> [44,] 0.0654 0.3196 0.43 #> [45,] 0.0672 0.3312 0.44 #> [46,] 0.0695 0.3442 0.45 #> [47,] 0.0724 0.3586 0.46 #> [48,] 0.0759 0.3743 0.47 #> [49,] 0.0800 0.3913 0.48 #> [50,] 0.0849 0.4094 0.49 #> [51,] 0.0905 0.4285 0.50 #> [52,] 0.0969 0.4484 0.51 #> [53,] 0.1041 0.4688 0.52 #> [54,] 0.1121 0.4895 0.53 #> [55,] 0.1209 0.5102 0.54 #> [56,] 0.1305 0.5307 0.55 #> [57,] 0.1409 0.5506 0.56 #> [58,] 0.1518 0.5698 0.57 #> [59,] 0.1633 0.5878 0.58 #> [60,] 0.1751 0.6045 0.59 #> [61,] 0.1872 0.6196 0.60 #> [62,] 0.1994 0.6329 0.61 #> [63,] 0.2114 0.6442 0.62 #> [64,] 0.2230 0.6534 0.63 #> [65,] 0.2341 0.6605 0.64 #> [66,] 0.2445 0.6653 0.65 #> [67,] 0.2538 0.6679 0.66 #> [68,] 0.2620 0.6683 0.67 #> [69,] 0.2688 0.6667 0.68 #> [70,] 0.2740 0.6632 0.69 #> [71,] 0.2775 0.6580 0.70 #> [72,] 0.2793 0.6513 0.71 #> [73,] 0.2791 0.6433 0.72 #> [74,] 0.2771 0.6343 0.73 #> [75,] 0.2732 0.6244 0.74 #> [76,] 0.2675 0.6137 0.75 #> [77,] 0.2601 0.6022 0.76 #> [78,] 0.2511 0.5897 0.77 #> [79,] 0.2409 0.5759 0.78 #> [80,] 0.2295 0.5608 0.79 #> [81,] 0.2172 0.5440 0.80 #> [82,] 0.2042 0.5254 0.81 #> [83,] 0.1906 0.5053 0.82 #> [84,] 0.1766 0.4842 0.83 #> [85,] 0.1623 0.4630 0.84 #> [86,] 0.1476 0.4430 0.85 #> [87,] 0.1327 0.4257 0.86 #> [88,] 0.1176 0.4123 0.87 #> [89,] 0.1023 0.0000 0.88 #> [90,] 0.0871 0.0000 0.89 #> [91,] 0.0721 0.0000 0.90 #> [92,] 0.0578 0.0000 0.91 #> [93,] 0.0444 0.0000 0.92 #> [94,] 0.0324 0.0000 0.93 #> [95,] 0.0222 0.0000 0.94 #> [96,] 0.0138 0.0000 0.95 #> [97,] 0.0075 0.0000 0.96 #> [98,] 0.0033 0.0000 0.97 #> [99,] 0.0009 0.0000 0.98 #> [100,] 0.0001 0.0000 0.99 #> [101,] 0.0000 0.0000 1.00