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.1k stars 935 forks source link

Regarding hotel booking estimate #770

Closed SaiAditya2595 closed 1 year ago

SaiAditya2595 commented 1 year ago

Ask your question Hi Amit, I have a question regarding the hotel booking example notebook. When I ran the notebook it gave an estimate of -0.2621. My question is how to infer the estimate from the notebook where the treatment and outcome are binary.

Expected behavior I have expected a probability value but got a value -0.26. is there any way to get the probability values for a logistic regression models with binary treatment and binary outcome?

Version information:

amit-sharma commented 1 year ago

you can refer to #383 for this. The output is the difference between two expected values of outcome.

ATE = E[Y|do(T=1)] - E[Y|do(T=0)]

If E[Y|do(T=1)] and E[Y|do(T=0)] are both between 0 and 1, then ATE lies between [-1, 1]. The negative estimate means that the treatment is decreasing the outcome.

SaiAditya2595 commented 1 year ago

Thank you so much for your quick response. The estimate of -0.26 which means that the probability of cancelling a room decreases when a different room assigned. Is there any way to get the individual probabilities of E[Y|do(T=1)] and E[Y|do(T=0)], Instead of generating a final ATE score?

amit-sharma commented 1 year ago

you can use the do method. CausalModel.do https://www.pywhy.org/dowhy/v0.8/dowhy.html#dowhy.causal_model.CausalModel.do

github-actions[bot] commented 1 year ago

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

github-actions[bot] commented 1 year ago

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