Skip to contents

This function runs a Bayesian sensitivity analysis for causal inference using JAGS or Stan as a backend.

Usage

bayesian_causens(
  exposure,
  outcome,
  confounders,
  data,
  backend = "jags",
  output_trace = FALSE,
  ...
)

Arguments

exposure

Exposure variable name in the data frame.

outcome

Outcome variable name in the data frame.

confounders

Confounders' names in the data frame.

data

A data frame containing the exposure, outcome, and confounder variables.

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.