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

The name of the exposure variable in the data frame.

outcome

The name of the outcome variable in the data frame.

confounders

The name of the confounders 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.