View source: R/robust_priors.R
| calibrate_power_prior | R Documentation |
Selects the power prior weight \delta \in (0,1) that down-weights
historical data before incorporating it into the current analysis.
calibrate_power_prior(
historical_data,
current_data,
base_prior,
target_bf = 3,
delta_grid = seq(0.05, 1, by = 0.05),
method = c("bayes_factor", "compatibility")
)
historical_data |
Named list: |
current_data |
Named list (same structure as |
base_prior |
A |
target_bf |
Numeric. Target Bayes Factor. Default |
delta_grid |
Numeric vector of |
method |
Character. |
A list of class bayprior_power_prior with components:
Optimal power prior weight selected by the chosen method.
The grid of delta values evaluated.
Bayes Factor at each delta value.
Box p-value at each delta value.
Data frame with all diagnostic metrics across the grid.
A bayprior object updated with the optimal delta.
The target Bayes Factor supplied by the user.
The calibration method used.
Ibrahim, J. G. & Chen, M.-H. (2000). Power prior distributions for regression models. Statistical Science, 15, 46-60.
Gravestock, I. & Held, L. (2017). Adaptive power priors with empirical Bayes for clinical trials. Pharmaceutical Statistics, 16, 349-360.
base <- elicit_beta(mean = 0.5, sd = 0.2, method = "moments",
label = "Response rate")
calib <- calibrate_power_prior(
historical_data = list(type = "binary", x = 12, n = 40),
current_data = list(type = "binary", x = 18, n = 50),
base_prior = base,
target_bf = 3
)
print(calib)
plot(calib)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.