Description Usage Arguments Examples
View source: R/ph2_single_bayes_seq_sim.R
Trial is a single arm Bayesian phase 2 trial with sequential stopping boundaries as outlined in Thall, Peter F., and Richard Simon. "Practical Bayesian guidelines for phase IIB clinical trials." Biometrics (1994): 337-349.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ph2_single_bayes_seq_sim(
theta_s_mu,
theta_s_width,
theta_s_w_conf_level = 0.9,
theta_e_c,
delta_0,
n_min,
n_max,
sim_n = 1,
pr_low = 0.05,
pr_high = 0.95,
mu_e = theta_s_mu + delta_0,
verbose = FALSE,
quiet = FALSE
)
|
theta_s_mu |
Mean of prior distribution on theta_s |
theta_s_width |
Width of the probability interval (set by |
theta_s_w_conf_level |
Confidence level of width of probabilty specified |
theta_e_c |
Concentration parameter for prior distribution on theta_e |
delta_0 |
Targeted improvement of treatment for treatment E over S |
n_min |
Minimum number of patients that may be enrolled |
n_max |
Maximum number of patients that may be enrolled |
sim_n |
Number of simulated trials to create |
pr_low |
Lower probability limit for concluding treatment not promising |
pr_high |
Upper probablity limit for concluding treatment promising |
mu_e |
True rate of success with experimental treatment
in |
verbose |
When TRUE, additional information is returned as an attribute |
quiet |
Run with no notes, progress bars, etc. |
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 | # simulate trial results
sim_results <- ph2_single_bayes_seq_sim(
# setting priors for standard treatment
theta_s_mu = 0.2, theta_s_width = 0.20, theta_s_w_conf_level = 0.90,
# setting priors for experimental treatment
theta_e_c = 2, delta_0 = 0.15,
# other trial parameters
n_min = 10, n_max = 65,
pr_low = 0.05, pr_high = 0.95,
# true effect of experimental tx
mu_e = 0.35,
# number of simulations
sim_n = 1000
)
# tabulate summary
library(gtsummary)
sim_results %>%
dplyr::select(-sim_id) %>%
tbl_summary(
label = list(result ~ "Trial Result",
n_enrolled ~ "No. Enrolled in Trial")
) %>%
add_stat_label() %>%
as_kable()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.