bayesian_causens {causens} | R Documentation |
Bayesian parametric sensitivity analysis for causal inference
Description
This function runs a Bayesian sensitivity analysis for causal inference using JAGS or Stan as a backend. For now, only JAGS is supported.
Usage
bayesian_causens(
trt_model,
outcome_model,
U_model,
data,
beta_uy = ~dunif(-2, 2),
alpha_uz = ~dunif(-2, 2),
backend = "jags",
output_trace = FALSE,
...
)
Arguments
trt_model |
The treatment model object as a formula. |
outcome_model |
The outcome model object as a formula. |
U_model |
The unmeasured confounder model object as a formula. |
data |
A data frame containing the exposure, outcome, and confounder variables. |
beta_uy |
Prior distribution for the effect of the missing confounder U on the outcome Y. |
alpha_uz |
Prior distribution for the effect of the missing confounder U on the treatment assignment mechanism Z. |
backend |
The backend to use for the sensitivity analysis. Currently only "jags" is supported. |
output_trace |
Whether to output the full trace of the MCMC sampler. |
... |
Additional arguments to be passed to the backend. |
Value
A list of posterior samples for the causal effect of the exposure variable on the outcome, as well as the confounder-adjusted causal effect.