calc_power_prior_norm {beastt}R Documentation

Calculate Power Prior Normal

Description

Calculate a (potentially inverse probability weighted) normal power prior using external data.

Usage

calc_power_prior_norm(
  external_data,
  response,
  prior = NULL,
  external_sd = NULL
)

Arguments

external_data

This can either be a prop_scr_obj created by calling create_prop_scr() or a tibble of the external data. If it is just a tibble the weights will be assumed to be 1. Only the external data for the arm(s) of interest should be included in this object (e.g., external control data if creating a power prior for the control mean)

response

Name of response variable

prior

Either NULL or a normal distributional object that is the initial prior for the parameter of interest (e.g., control mean) before the external data are observed

external_sd

Standard deviation of external response data if assumed known. It can be left as NULL if assumed unknown

Details

Weighted participant-level response data from an external study are incorporated into an inverse probability weighted (IPW) power prior for the parameter of interest θ\theta (e.g., the control mean if borrowing from an external control arm). When borrowing information from an external dataset of size NEN_{E}, the IPW likelihood of the external response data yEy_E with weights a^0\hat{\boldsymbol{a}}_0 is defined as

LE(θyE,a^0,σE2)exp(12σE2i=1NEa^0i(yiθ)2).\mathcal{L}_E(\theta \mid \boldsymbol{y}_E, \hat{\boldsymbol{a}}_0, \sigma_{E}^2) \propto \exp \left( -\frac{1}{2 \sigma_{E}^2} \sum_{i=1}^{N_{E}} \hat{a}_{0i} (y_i - \theta)^2 \right).

The prior argument should be either a distributional object with a family type of normal or NULL, corresponding to the use of a normal initial prior or an improper uniform initial prior (i.e., π(θ)1\pi(\theta) \propto 1), respectively.

The external_sd argument can be a positive value if the external standard deviation is assumed known or left as NULL otherwise. If external_sd = NULL, then prior must be NULL to indicate the use of an improper uniform initial prior for θ\theta, and an improper prior is defined for the unknown external standard deviation such that π(σE2)(σE2)1\pi(\sigma_E^2) \propto (\sigma_E^2)^{-1}. The details of the IPW power prior for each case are as follows:

⁠external_sd = positive value⁠ (σE2\sigma_E^2 known):

With either a proper normal or an improper uniform initial prior, the IPW weighted power prior for θ\theta is a normal distribution.

external_sd = NULL (σE2\sigma_E^2 unknown):

With improper priors for both θ\theta and σE2\sigma_E^2, the marginal IPW weighted power prior for θ\theta after integrating over σE2\sigma_E^2 is a non-standardized tt distribution.

Defining the weights a^0\hat{\boldsymbol{a}}_0 to equal 1 results in a conventional normal (or tt) power prior if the external standard deviation is known (unknown).

Value

Normal power prior object

See Also

Other power prior: calc_power_prior_beta()

Examples

library(distributional)
library(dplyr)
# This function can be used directly on the data
calc_power_prior_norm(ex_norm_df,
  response = y,
  prior = dist_normal(50, 10),
  external_sd = 0.15)

# Or this function can be used with a propensity score object
ps_obj <- calc_prop_scr(internal_df = filter(int_norm_df, trt == 0),
                       external_df = ex_norm_df,
                       id_col = subjid,
                       model = ~ cov1 + cov2 + cov3 + cov4)
calc_power_prior_norm(ps_obj,
                     response = y,
                     prior = dist_normal(50, 10),
                     external_sd = 0.15)


[Package beastt version 0.0.1 Index]