Calculate Bayesian Predictive Probability given interim data and posterior samples
BPP_func.RdCalculate Bayesian Predictive Probability given interim data and posterior samples
Usage
BPP_func(
data,
posterior_df,
control_distribution = "Exponential",
n_c_planned,
n_t_planned,
rec_time_planned,
df_cens_time,
censoring_model,
analysis_model,
n_sims = 500
)Arguments
- posterior_df
A data frame of posterior samples with columns:
lambda_c,delay_timeandHR, corresponding to the control hazard, the delay (changepoint) time and the post-delay hazard ratio, respectively.- control_distribution
Distributional form assumed for the control arm: either
"Exponential"(default) or"Weibull".- n_c_planned
Planned maximum number of patients in the control group.
- n_t_planned
Planned maximum number of patients in the treatment group.
- rec_time_planned
Planned maximum recruitment calendar time for the full trial.
- df_cens_time
Calendar time at which
dfhas been censored (interim analysis time).- censoring_model
A named list specifying the censoring mechanism for the future data:
method: one of"Time","Events", or"IF".time,events,IF: parameters for the corresponding method.
- analysis_model
A named list specifying the final analysis and decision rule:
method: e.g."LRT","WLRT", or"MW".alpha: one-sided type I error level.alternative_hypothesis: direction of the alternative (e.g."one.sided").rho,gamma,t_star,s_star: additional parameters for WLRT or MW (if applicable).
- n_sims
Number of predictive simulations to run (default is 1000).
- df
A data frame containing interim survival data, censored at
df_cens_time, with columns:timeFinal observed/event time at the interim (on the analysis time scale).groupTreatment group indicator (e.g. "Control", "Treatment").rec_timeRecruitment (calendar) time.pseudo_timetime + rec_time(calendar time at event/censoring).statusEvent indicator at the interim (1 = event, 0 = censored).survival_timeObserved follow-up time from randomisation to event/censoring at the interim.