py-why / dowhy

DoWhy is a Python library for causal inference that supports explicit modeling and testing of causal assumptions. DoWhy is based on a unified language for causal inference, combining causal graphical models and potential outcomes frameworks.
https://www.pywhy.org/dowhy
MIT License
7.04k stars 926 forks source link

Backdoor path #1044

Closed asha24choudhary closed 11 months ago

asha24choudhary commented 12 months ago

Hi. I have the following causal graph (chain structure).

image

According to my knowledge, there is no backdoor path. But when I do model.identify_effect, it shows that there is a backdoor path. Please see it in the following figure. Although, the backdoor set is empty, which is the variable or the set of variables that should be conditioned on block the backdoor path afaik. I do not understand why it says that there is a backdoor on the first place. Please find it in this pic.

image

Also if I rearrange the chain structure into this one

image

And again identify the effect, I still get backdoor expression which you can see here

image

Could you please explain me what am I missing?

Thank you in advance!

github-actions[bot] commented 11 months ago

This issue is stale because it has been open for 14 days with no activity.

github-actions[bot] commented 11 months ago

This issue was closed because it has been inactive for 7 days since being marked as stale.

amit-sharma commented 11 months ago

@asha24choudhary The identify_effect provides you the formula for estimating causal effect using the backdoor criterion. In your example, the backdoor variables set is empty. That's what is shown in the output too. But the null set is still a valid backdoor set and therefore you can use the null set in any downstream estimator to estimate the causal effect.

short answer: If the estimand only shows Y and X but no other conditioning variables, then there is no backdoor path (as you said) and hence the causal effect can be computed directly as E[Y|X].

asha24choudhary commented 11 months ago

Thank you so much @amit-sharma for your explanation.