santikka/causaleffect

Questions on behavior for 3 variables example

Closed this issue · 2 comments

I'm trying an example extracted from Shpitser et al, 2012, On the Validity of Covariate Adjustment for Estimating Causal Effects. Figure 1b)

fig1 <- graph.formula(X -+ Z, X -+Y, simplify = TRUE)
ce1 <- causal.effect(y = "Y", x = "X", z = NULL, G = fig1, expr = TRUE)
cat(ce1)

Returned formula from causaleffect is P(Y|X), different from \sum_{Z}P(Y|Z,X)P(Z) that is described in the paper. Is this OK?

Moreover, if we reverse the directed edge between X and Z...:

fig1 <- graph.formula(X +- Z, X -+Y, simplify = TRUE)
ce1 <- causal.effect(y = "Y", x = "X", z = NULL, G = fig1, expr = TRUE)
cat(ce1)

causaleffect returns P(Y|Z,X). Is this OK? It looks like a conditional (or restricted) causal effect. Moreover I think the graph is suitable for the "parent adjustment" (proposition 6.41 from Elements of Causal Inference, Peters et al). Am I wrong?

Thank you very much for this great package! :)

Yes, both expressions are ok.

In the first example, note that Y is d-separated from Z by X, and if we were to use the formula \sum_{Z}P(Y|Z,X)P(Z) the term P(Y|Z,X) simplifies to P(Y|X) and we can directly marginalize over P(Z) to get just P(Y|X). While you can do the adjustment via Z, it is not necessary in this case (Z is not confounding the relationship of X and Y).

The second example is similar but slightly different. Again, Y is d-separated from Z by X, so there is a conditional independence that says that P(Y|Z,X) = P(Y|X) However, causaleffect does not automatically remove extraneous variables by using conditional independences from the final expression. Similarly to the first example, you can adjust for Z, but it is not necessary, since there is no confounding.

Thanks for the feedback! EDIT: Misread second graph, but point still stands

So, if I understood, in both cases adjusting for Z is valid though not required. Unlike typical confounder example X +- Z, Y +- Z, X -+Y, where adjusting for Z is both valid and required, and the collider bias example X -+ Z, Y -+ Z, X -+Y where adjusting for Z is not valid adjustment. I guess my misunderstanding as a newbie came from considering all non-required adjustments as not valid.

Thanks a lot for your clarification!