Function for calculating the minimum required number of responders in the experimental group to make a GO decision in Settings 3 and 4.

req_resp_rct(
  N_c,
  N_e,
  delta,
  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,
  plot = T
)

Arguments

N_c

Sample Size in the control group.

N_e

Sample Size in the experimental group.

delta

Required superiority to make a "GO" decision. Corresponds to \(\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\).

plot

Plots yes or no. Default is TRUE.

Value

Matrix containing pairs of successes in control group and respective required successes in experimental group.

Examples

# Setting 3 req_resp_rct( N_c = 25, N_e = 25, delta = 0.08, confidence = 0.6 )
#> Suc. in Con. Req. Suc. in Exp. #> [1,] 0 4 #> [2,] 1 5 #> [3,] 2 6 #> [4,] 3 7 #> [5,] 4 8 #> [6,] 5 9 #> [7,] 6 10 #> [8,] 7 11 #> [9,] 8 12 #> [10,] 9 13 #> [11,] 10 14 #> [12,] 11 15 #> [13,] 12 16 #> [14,] 13 17 #> [15,] 14 18 #> [16,] 15 19 #> [17,] 16 20 #> [18,] 17 21 #> [19,] 18 22 #> [20,] 19 23 #> [21,] 20 24 #> [22,] 21 25 #> [23,] 22 NA #> [24,] 23 NA #> [25,] 24 NA #> [26,] 25 NA
# Setting 4 req_resp_rct( N_c = 25, N_e = 25, delta = 0.08, confidence = 0.6, RR_h = 0.5, N_h = 50, w = 0.3 )
#> Suc. in Con. Req. Suc. in Exp. #> [1,] 0 4 #> [2,] 1 5 #> [3,] 2 6 #> [4,] 3 7 #> [5,] 4 9 #> [6,] 5 10 #> [7,] 6 12 #> [8,] 7 13 #> [9,] 8 14 #> [10,] 9 15 #> [11,] 10 16 #> [12,] 11 16 #> [13,] 12 17 #> [14,] 13 17 #> [15,] 14 17 #> [16,] 15 18 #> [17,] 16 18 #> [18,] 17 19 #> [19,] 18 20 #> [20,] 19 22 #> [21,] 20 23 #> [22,] 21 25 #> [23,] 22 NA #> [24,] 23 NA #> [25,] 24 NA #> [26,] 25 NA