Function to analyze a Bayesian trial for binomial count data which allows for early stopping and incorporation of historical data using the discount function approach.
binomial_analysis( treatment, outcome, complete = NULL, p_treatment = 0, N_max_treatment = NULL, N_max_control = NULL, y0_treatment = NULL, N0_treatment = NULL, y0_control = NULL, N0_control = NULL, alternative = "greater", N_impute = 10, h0 = 0, number_mcmc = 10000, prob_ha = 0.95, futility_prob = 0.1, expected_success_prob = 0.9, prior = c(1, 1), discount_function = "identity", fix_alpha = FALSE, alpha_max = 1, weibull_scale = 0.135, weibull_shape = 3, method = "fixed" )
treatment | vector. Treatment assignment for patients, 1 for treatment group and 0 for control group |
---|---|
outcome | vector. Binomial outcome of the trial, 1 for response (success or failure), 0 for no response. |
complete | vector. Similar length as treatment and outcome variable, 1 for complete outcome, 0 for loss to follow up. If complete is not provided, the dataset is assumed to be complete. |
p_treatment | scalar. Proportion of events under the treatment arm. |
N_max_treatment | integer. Maximum allowable sample size for the treatment arm (including the currently enrolled subjects). Default is NULL, meaning we are already at the final analysis. |
N_max_control | integer. Maximum allowable sample size for the control arm (including the currently enrolled subjects). Default is NULL, meaning we are already at the final analysis. |
y0_treatment | scalar. Number of events for the historical treatment arm. |
N0_treatment | scalar. Number of observations of the historical treatment group. |
y0_control | scalar. Number of events for the historical control arm. |
N0_control | scalar. Number of observations of the historical control group. |
alternative | character. The string specifying the alternative
hypothesis, must be one of |
N_impute | scalar. Number of imputations for Monte Carlo simulation of missing data. |
h0 | scalar. Threshold for comparing two mean values. Default is
|
number_mcmc | scalar. Number of Markov Chain Monte Carlo draws in sampling posterior. |
prob_ha | scalar. Probability of alternative hypothesis. |
futility_prob | scalar. Probability of stopping early for futility. |
expected_success_prob | scalar. Probability of stopping early for success. |
prior | vector. Prior values of beta rate, Beta(a0, b0). The default is set to Beta(1, 1). |
discount_function | character. If incorporating historical data, specify
the discount function. Currently supports the Weibull function
( |
fix_alpha | logical. Fix alpha at alpha_max? Default value is FALSE. |
alpha_max | scalar. Maximum weight the discount function can apply. Default is 1. For a two-arm trial, users may specify a vector of two values where the first value is used to weight the historical treatment group and the second value is used to weight the historical control group. |
weibull_scale | scalar. Scale parameter of the Weibull discount function
used to compute alpha, the weight parameter of the historical data. Default
value is 0.135. For a two-arm trial, users may specify a vector of two
values where the first value is used to estimate the weight of the
historical treatment group and the second value is used to estimate the
weight of the historical control group. Not used when
|
weibull_shape | scalar. Shape parameter of the Weibull discount function
used to compute alpha, the weight parameter of the historical data. Default
value is 3. For a two-arm trial, users may specify a vector of two values
where the first value is used to estimate the weight of the historical
treatment group and the second value is used to estimate the weight of the
historical control group. Not used when |
method | character. Analysis method with respect to estimation of the
weight parameter alpha. Default method |
A list of output for the Bayesian trial for binomial count:
prob_of_accepting_alternative
integer. The input parameter of probability of accepting the alternative.
margin
scalar. The margin input value of difference between mean estimate of treatment and mean estimate of the control.
alternative
character. The input parameter of alternative hypothesis.
N_treatment
integer. The number of patients enrolled in the experimental group for each simulation.
N_control
integer. The number of patients enrolled in the control group for each simulation.
N_enrolled
vector. The number of patients enrolled in the trial (sum of control and experimental group for each simulation.)
N_complete
integer. The number of patients who completed the trial and had no loss to follow-up.
N_max_treatment
integer. Maximum allowable sample size for the treatment arm (including the currently enrolled subjects).
N_max_control
integer. Maximum allowable sample size for the control arm (including the currently enrolled subjects).
post_prob_accept_alternative
scalar. The final probability of accepting the alternative hypothesis after the analysis is done.
est_final
scalar. The final estimate of the difference in posterior estimate of treatment and posterior estimate of the control group.
stop_futility
integer. Did the trial stop for futility during imputation of patient who had loss to follow up? 1 for yes and 0 for no.
stop_expected_success
integer. Did the trial stop for early success during imputation of patient who had loss to follow up? 1 for yes and 0 for no.
If the enrollment size is at the final sample size, i.e. the maximum allowable sample size for the trial, then this function is not of practical use since there is no opportunity to stop trial enrollment. In such a case, it is expected that the follow-up will be conducted per the study protocol and a final analysis made.