pcalg icon indicating copy to clipboard operation
pcalg copied to clipboard

Issue with the causalEffect function?

Open fdabl opened this issue 6 years ago • 1 comments

Hi,

I want to estimate the Average Causal Effect (ACE) of X on Y using the causalEffect function. However, it seems that it only takes into account direct edges, see example below.

`` set.seed(1)

g <- randDAG(3, 2) plot(g) causalEffect(g, 1, 2) ``

returns the direct effect of 2 on 1 (0.4349115) instead of the total effect (0.4349115 + 0.4349115*0.615568).

Am I missing something, or is this a bug? As far as I understand, ACE is defined as E(Y | do(X = z)) - E(Y| do(X = z+1)) which should yield the total effect, as, in the example above, intervening on 2 also changes 3 which impacts 1.

Thanks for any help!

Cheers, Fabian

fdabl avatar Aug 28 '18 10:08 fdabl

You are asking a question in a wrong forum :) This GitHub site provides a Python package just simply to estimate a CPDAG using the PC algorithm. No other functions are provided.

I guess you are using the pcalg package for R. Please contact to the original author of the R package (https://cran.r-project.org/web/packages/pcalg/).

keiichishima avatar Sep 10 '18 09:09 keiichishima