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.
Ask your question
I have created causal models and estimands for a range of cases - backdoor, front door, instrumental variable and also for where front door and instrumental variables have unobserved confounders. All of these work for calculating the ate.
I have now tried to run the do operator for a graph where there is an instrumental variable and an unobserved backdoor confounder but it crashes with KeyError: 'backdoor'
The do operator only works where there is an observed backdoor confounder which is very disappointing as it rules out a lot of use cases.
Ask your question I have created causal models and estimands for a range of cases - backdoor, front door, instrumental variable and also for where front door and instrumental variables have unobserved confounders. All of these work for calculating the ate.
I have now tried to run the do operator for a graph where there is an instrumental variable and an unobserved backdoor confounder but it crashes with KeyError: 'backdoor'
The do operator only works where there is an observed backdoor confounder which is very disappointing as it rules out a lot of use cases.
Here is the code ...
variable_types = {'engagement': 'd', 'retention': 'd', 'funding': 'd'} gml_graph = 'graph [directed 1\n\tnode [id "funding" label "funding"]\n\tnode [id "engagement" label "engagement"]\n\tnode [id "retention" label "retention"]\n\tnode [id "U" label "U"]\n\tedge [source "funding" target "engagement"]\n\tedge [source "engagement" target "retention"]\n\tedge [source "U" target "engagement"]\n\tedge [source "U" target "retention"]\n]'
df_do = df_student_retention.causal.do(x={"engagement": 1}, outcome="retention", dot_graph=gml_graph, variable_types=variable_types, proceed_when_unidentifiable=True)
Expected behavior I would expect df_do to be populated with the results of the do operation
Version information: 0.9
Additional context As stated above, it all works for calculating the ate, just not for running a "do" operation