Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No common causes/confounders present. #1053

Closed
sinya2 opened this issue Oct 30, 2023 · 3 comments
Closed

No common causes/confounders present. #1053

sinya2 opened this issue Oct 30, 2023 · 3 comments
Labels
question Further information is requested stale

Comments

@sinya2
Copy link

sinya2 commented Oct 30, 2023

Hi! I've tried to investigate causality between lung cancer and smoking using this dataset.
I've built such casual graph:
image

But I have an error Exception: No common causes/confounders present. Propensity score based methods are not applicable
after applying this code:


causal_graph =  '''digraph { 
                    CHRONIC_DISEASE;
                    AGE;
                    GENDER;
                    PEER_PRESSURE;
                    CHEST_PAIN;
                    SMOKING -> {YELLOW_FINGERS, COUGHING, LUNG_CANCER, CHRONIC_DISEASE};
                    LUNG_CANCER  -> {CHEST_PAIN,SHORTNESS_OF_BREATH, FATIGUE, WHEEZING};
                    CHRONIC_DISEASE -> {LUNG_CANCER, PEER_PRESSURE, FATIGUE, WHEEZING};
                    ALCOHOL_CONSUMING -> {CHRONIC_DISEASE, FATIGUE};
                    AGE -> {CHRONIC_DISEASE, FATIGUE, LUNG_CANCER};
                    GENDER  -> {CHRONIC_DISEASE, FATIGUE};
                    }'''

model= CausalModel(
    data = df,
    graph=causal_graph.replace("\n", " "),
    treatment="SMOKING",
    outcome='LUNG_CANCER')

model.view_model()
identified_estimand = model.identify_effect(proceed_when_unidentifiable=True)
print(identified_estimand)
estimate = model.estimate_effect(identified_estimand, 
                             method_name="backdoor.propensity_score_weighting",target_units="ate")

Also I am confused by having such estimands. Do not it suppose also to show what variables have to be controlled?

Estimand type: EstimandType.NONPARAMETRIC_ATE
### Estimand : 1
Estimand name: backdoor
Estimand expression:
    d                     
──────────(E[LUNG_CANCER])
d[SMOKING]                
Estimand assumption 1, Unconfoundedness: If U→{SMOKING} and U→LUNG_CANCER then P(LUNG_CANCER|SMOKING,,U) = P(LUNG_CANCER|SMOKING,)

Version information:

  • DoWhy version [e.g. 0.7]

I have dowhy version 0.10.1.

@sinya2 sinya2 added the question Further information is requested label Oct 30, 2023
@amit-sharma
Copy link
Member

amit-sharma commented Nov 4, 2023

@sinya2 in your causal graph, the correct way to estimate causal effect is to simply compute $\mathbf{E}[Lung Cancer |Smoking]$. There is no confounding common cause. That is what the estimand is describing. Usually it shows which variables need to be controlled, but here you do not need to control any variable.

That is also the reason why propensity score methods are throwing an error. They depend on creating a treatment propensity model using the confounding common causes. For your problem, you can simply use linear regression estimator or S-learner from EconML to compute the causal effect.

Copy link

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

@github-actions github-actions bot added the stale label Nov 19, 2023
Copy link

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

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested stale
Projects
None yet
Development

No branches or pull requests

2 participants