Wrapper function to analyze Bayesian trials.

analysis(
  input,
  type = "binomial",
  N_max_treatment = NULL,
  N_max_control = NULL,
  .data = NULL
)

Arguments

input

list. Input function for all the analysis.

type

character. Type of analysis to be ran (binomial (default), normal. etc.).

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.

.data

NULL. Stores the binomial data for analysis. Should not be edited by user.

Value

A list with results of the analysis of Bayesian trial.

prob_of_accepting_alternative

scalar. 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

scalar. The number of patients enrolled in the experimental group for each simulation.

N_control

scalar. 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

scalar. The number of patients who completed the trial and had no loss to follow-up.

post_prob_accept_alternative

vector. 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

scalar. Did the trial stop for futility during imputation of patients who had loss to follow up? 1 for yes and 0 for no.

stop_expected_success

scalar. Did the trial stop for early success during imputation of patients who had loss to follow up? 1 for yes and 0 for no.