View source: R/bayesian_causens.R
bayesian_causens | R Documentation |
This function runs a Bayesian sensitivity analysis for causal inference using JAGS or Stan as a backend. For now, only JAGS is supported.
bayesian_causens(
trt_model,
outcome_model,
U_model,
data,
beta_uy = ~dunif(-2, 2),
alpha_uz = ~dunif(-2, 2),
backend = "jags",
output_trace = FALSE,
...
)
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. |
A list of posterior samples for the causal effect of the exposure variable on the outcome, as well as the confounder-adjusted causal effect.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.