bindagCausalEffectBackdoor: Estimates Average Causal Effects by Covariate Adjustment in...

Description Usage Arguments Details Value References Examples

Description

Estimate the average causal effect (ACE) of a given treatment variable X on a given outcome Y by adjusting for a set S of covariates (equivalenly, assuming S blocks all backdoor paths in the causal graph that generates the observations). . Bounds are based on finding conditional instrumental variables using the faithfulness assumption relaxed to allow for a moderate degree of unfaithfulness. Candidate models are generated from the method described in covsearch.

Usage

1
bindagCausalEffectBackdoor(problem, prior_table, S)

Arguments

problem

a cfx problem instance for the ACE of a given treatment X on a given outcome Y.

prior_table

effective sample size hyperparameter of a Dirichlet prior for testing independence with contingency tables.

S

an array indicating the indices of the covariates used in the adjustment.

Details

The algorithm implemented is a naive one. If the dimensionality of S is larger than around 20, this may crash the system. This function is assumed to be used along other methods such as covsearch and wpp, which generate relativelty small covariate sets.

Value

the estimated ACE.

References

Pearl, J. (2000) Causality: Models, Reasoning and Inference. Cambridge University Press.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Generate a synthetic problem
problem <- simulateWitnessModel(p = 4, q = 4, par_max = 3, M = 1000)

## Idealized case: suppose we know the true distribution,
## get "exact" ACE estimands for different adjustment sets
sol_pop <- covsearch(problem, pop_solve = TRUE)
effect_pop <- synthesizeCausalEffect(problem)
cat(sprintf(
  "ACE (true) = %1.2f\nACE (adjusting for all) = %1.2f\nACE (adjusting for nothing) = %1.2f\n",
   effect_pop$effect_real, effect_pop$effect_naive, effect_pop$effect_naive2))

## Perform inference and report results
covariate_hat <- covsearch(problem, cred_calc = TRUE, M = 1000)
if (length(covariate_hat$witness) > 1) {
  sol_ACE <- bindagCausalEffectBackdoor(problem, prior_table = 10, S = covariate_hat$Z[[1]])
  cat(sprintf("Estimated ACE = %1.2f\n", sol_ACE))
}

rbas2015/CausalFX documentation built on May 27, 2019, 2:06 a.m.