set_prior: Specify prior distributions and predictors for MCMC methods

View source: R/add_mcmc.R

set_priorR Documentation

Specify prior distributions and predictors for MCMC methods

Description

Specify prior distributions and predictors for MCMC methods

Usage

set_prior(pred, prior, r0, alpha, sigma)

Arguments

pred

Predictors to include in the weibull distribution. No covariates except for treatment indicator is included if pred = NULL. Only propensity score generated using a logistic regression model on all covariates and treatment indicator are included if pred = ps. All covariates and treatment indicator are included if pred = all

prior

Prior distribution for the precision parameter that controls the degree of borrowing. Half-cauchy distribution if prior = "cauchy". No external data is included in the data if prior = "no_ext". External control arm is assumed to have the same baseline hazards as internal control arm if prior = "full_ext". Other options include "gamma" and "unif"

r0

Initial values for the shape of the weibull distribution for time-to-events

alpha

Initial values for log of baseline hazard rate for external and internal control arms. Length of alpha should be 1 if prior = "full_ext" or prior = "no_ext", and equal to 2 otherwise

sigma

Initial values for precision parameter if prior = "cauchy". If left NULL, default value 0.03 is used

Value

a .priorClass class containing survival data and prior information

Examples

# hierachical Bayesian model with precision parameter follows a half-cauchy distribution
set_prior(pred = "none", prior = "cauchy", r0 = 1, alpha = c(0, 0), sigma = 0.03)

# hierachical Bayesian model with precision parameter follows a gamma distribution
set_prior(pred = "none", prior = "gamma", r0 = 1, alpha = c(0, 0))

# conventional Bayesian model to not borrow from external control arm
set_prior(pred = "none", prior = "no_ext", alpha = 0)

# conventional Bayesian model to fully borrow from external control arm
set_prior(pred = "none", prior = "full_ext", alpha = 0)



psborrow documentation built on March 7, 2023, 8:32 p.m.