-
Notifications
You must be signed in to change notification settings - Fork 992
Open
Labels
bugSomething isn't workingSomething isn't working
Description
It is ignoring mediator M2:
import dowhy
vertices = ['D', 'M1', 'M2', 'Y']
dag = """
D -> {M1, M2, Y}
M1 -> Y
M2 -> Y
"""
G = dowhy.CausalModel(data=pd.DataFrame(columns=vertices),
graph=f"digraph{{{dag}}}",
treatment = "D",
outcome="Y",
)
print(G.identify_effect(estimand_type='nonparametric-nie'))
Estimand type: EstimandType.NONPARAMETRIC_NIE
### Estimand : 1
Estimand name: mediation
Estimand expression:
⎡ d d ⎤
E⎢─────(Y)⋅────([M₁])⎥
⎣d[M₁] d[D] ⎦
Estimand assumption 1, Mediation: M1 intercepts (blocks) all directed paths from D to Y except the path {D}→{Y}.
Estimand assumption 2, First-stage-unconfoundedness: If U→{D} and U→{M1} then P(M1|D,U) = P(M1|D)
Estimand assumption 3, Second-stage-unconfoundedness: If U→{M1} and U→Y then P(Y|M1, D, U) = P(Y|M1, D)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working