Skip to contents

The value is not the number at step three. It is that identification says WHICH quantity the data can speak to, estimation produces it, and refutation asks whether it survives perturbations that ought not to change it: a placebo treatment (should collapse to zero), a random common cause (should not move it) and random subsets (spread should match the standard error).

Usage

morie_identify_estimate_refute(
  dag,
  data,
  treatment,
  outcome,
  adjustment = NULL,
  n_refute = 100L,
  seed = 0L,
  alpha = 0.05
)

Arguments

dag

Logical adjacency matrix; dag[i, j] means i -> j.

data

Observations, one column per node.

treatment, outcome

Column indices (1-based).

adjustment

Force a particular set instead of identifying one.

n_refute

Replications per refutation.

seed

Random seed.

alpha

Two-sided level.

Value

A list with estimate, se, identified, adjustment_set, placebo_effect, random_cause_effect, subset_sd, refutations_passed, warnings.

Details

Adjusting for everything measured is not conservative. Conditioning on a mediator removes part of the effect being measured, and conditioning on a collider CREATES an association where none existed. Both are flagged and the estimate still returned, so the damage is visible rather than merely warned about.

References

Pearl J (2009) Causality, 2nd ed., Sec 3.3. Sharma A, Kiciman E (2020) arXiv:2011.04216.

Examples

# \donttest{
set.seed(13)
n <- 500
Z <- rnorm(n); T <- rbinom(n, 1, plogis(Z)); Y <- 1 + 2 * T + Z + rnorm(n)
dag <- matrix(FALSE, 3, 3, dimnames = list(c("Z", "T", "Y"), c("Z", "T", "Y")))
dag["Z", "T"] <- dag["Z", "Y"] <- dag["T", "Y"] <- TRUE
r <- morie_identify_estimate_refute(dag, data.frame(Z, T, Y), treatment = 2, outcome = 3, n_refute = 20L)
r[c("estimate", "adjustment_set", "refutations_passed")]
#> $estimate
#> [1] 1.877551
#> 
#> $adjustment_set
#> [1] 1
#> 
#> $refutations_passed
#> [1] 3
#> 
# }