Skip to contents

Unified v1.6.0 entry point for Pillar 1. Returns an edaphos_posterior() with posterior draws over the identified direct effect, ready for uncertainty_calibrate() and ggplot2::autoplot(). For the LM estimator the draws are a cluster-block bootstrap; for BART the draws are the native Markov- chain posterior.

Usage

causal_effect_posterior(
  data,
  dag,
  exposure,
  outcome,
  adjustment = NULL,
  estimator = c("lm", "bart"),
  cluster = "kmeans_cluster",
  B = 500L,
  seed = NULL,
  bart_kwargs = list(),
  delta = NULL,
  units = NULL
)

Arguments

data

A data frame.

dag

A dagitty DAG (required when adjustment = NULL).

exposure, outcome

Character; column names.

adjustment

Optional character vector of adjustment-set columns; derived from the DAG if NULL.

estimator

"lm" or "bart".

cluster, B, seed

See causal_effect_bootstrap(); only used for the LM estimator.

bart_kwargs

Named list of extra arguments forwarded to dbarts::bart() when estimator = "bart".

delta

Numeric; counterfactual increment for the BART estimator (defaults to IQR(exposure) / 2).

units

Optional character; free-text tag passed through to the edaphos_posterior.

Value

An edaphos_posterior with query_type = "effect" and method set to "bootstrap" (LM) or "bayesian" (BART).