calc_power_prior_beta {beastt} | R Documentation |
Calculate Power Prior Beta
Description
Calculate a (potentially inverse probability weighted) beta power prior for the control response rate using external control data.
Usage
calc_power_prior_beta(external_data, response, prior)
Arguments
external_data |
This can either be a |
response |
Name of response variable |
prior |
A beta distributional object that is the initial prior for the control response rate before the external control data are observed |
Details
Weighted participant-level response data from an external study are
incorporated into an inverse probability weighted (IPW) power prior for the
control response rate . When borrowing information from an
external control arm of size
, the components of the IPW power
prior for
are defined as follows:
- Initial prior:
- IPW likelihood of the external response data
with weights
:
- IPW power prior:
Defining the weights to equal 1 results in a
conventional beta power prior.
Value
Beta power prior object
See Also
Other power prior:
calc_power_prior_norm()
Examples
library(distributional)
library(dplyr)
# This function can be used directly on the data
calc_power_prior_beta(external_data = ex_binary_df,
response = y,
prior = dist_beta(0.5, 0.5))
# Or this function can be used with a propensity score object
ps_obj <- calc_prop_scr(internal_df = filter(int_binary_df, trt == 0),
external_df = ex_binary_df,
id_col = subjid,
model = ~ cov1 + cov2 + cov3 + cov4)
calc_power_prior_beta(ps_obj,
response = y,
prior = dist_beta(0.5, 0.5))