avg_oc_wr_ne_rct {earlygating} | R Documentation |
RCT Average Operating Characteristics
Description
Function for calculating the average operating characteristics of two RCT bayesian designs for early gating with respect to the sample size in the experimental group, the sample size in the control group and possible historical data.
Usage
avg_oc_wr_ne_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,
N_h = NULL,
RR_h = NULL,
w = NULL,
alpha_c,
beta_c,
trues = seq(0, 1, 0.01),
plot = T,
coresnum = NULL,
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_power |
Superiority, at which decision power will be evaluated.
Corresponds to |
confidence |
Required confidence to make "GO" decision. Corresponds to |
e_a |
Alpha parameter of Beta Prior Distribution for the experimental response rate.
Corresponds to |
e_b |
Beta parameter of Beta Prior Distribution for the experimental response rate.
Corresponds to |
c_a |
Alpha parameter of Beta Prior Distribution for the control response rate.
Corresponds to |
c_b |
Beta parameter of Beta Prior Distribution for the control response rate.
Corresponds to |
h_a |
Alpha parameter of Beta Prior Distribution for the historical control response rate.
Corresponds to |
h_b |
Beta parameter of Beta Prior Distribution for the historical control response rate.
Corresponds to |
N_h |
Historical control sample size. Corresponds to |
RR_h |
Historical control response rate. Corresponds to |
w |
Level of dynmaic borrowing. Corresponds to |
alpha_c |
Alpha parameter of Beta Distribution for the control response rate used to
calculate average operating characteristics. Corresponds to |
beta_c |
Beta parameter of Beta Distribution for the control response rate used to calculate
average operating characteristics. Corresponds to |
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. |
coresnum |
Number of cores used for parallel computing, in case N_e is a vector. Default is the number of total cores - 1. |
legend |
Logical; whether or not to include legend in plot. Default is TRUE. |
legend.pos |
Position of legend. Default is "topleft". |
Value
Either a vector containing the average decision power and average alpha (if N_e has length 1) or a matrix containing the average decision power and average decision alpha (if N_e has length > 1), where every row corresponds to one value of N_e.
Examples
# Setting 3
avg_oc_wr_ne_rct(
N_c = 25, N_e = 25, delta = 0.08,
delta_power = 0.13, confidence = 0.6,
alpha_c = 15, beta_c = 13
)
# Setting 4
avg_oc_wr_ne_rct(
N_c = 25, N_e = 25, delta = 0.08,
delta_power = 0.13, confidence = 0.6,
alpha_c = 15, beta_c = 13,
RR_h = 0.5, N_h = 100, w = 0.3
)