calibrate_power_prior: Calibrate power prior weight via Bayes Factor

View source: R/robust_priors.R

calibrate_power_priorR Documentation

Calibrate power prior weight via Bayes Factor

Description

Selects the power prior weight \delta \in (0,1) that down-weights historical data before incorporating it into the current analysis.

Usage

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")
)

Arguments

historical_data

Named list: type, x, n, optionally sd.

current_data

Named list (same structure as historical_data).

base_prior

A bayprior object (usually a vague prior).

target_bf

Numeric. Target Bayes Factor. Default 3.

delta_grid

Numeric vector of \delta values. Default seq(0.05, 1.0, by = 0.05).

method

Character. "bayes_factor" (default) or "compatibility".

Value

A list of class bayprior_power_prior with components:

delta_opt

Optimal power prior weight selected by the chosen method.

delta_grid

The grid of delta values evaluated.

bf_grid

Bayes Factor at each delta value.

compatibility_grid

Box p-value at each delta value.

results

Data frame with all diagnostic metrics across the grid.

power_prior

A bayprior object updated with the optimal delta.

target_bf

The target Bayes Factor supplied by the user.

method

The calibration method used.

References

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.

Examples

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)


bayprior documentation built on Aug. 27, 2026, 1:09 a.m.