dowhy icon indicating copy to clipboard operation
dowhy copied to clipboard

DoWhy with Multiple Treatments (T) and Multiple Outcomes (Y)

Open titubs opened this issue 3 years ago • 7 comments

Hi, @emrekiciman
I have been looking to see if DoWhy supports Multiple Treatments (T) and Multiple Outcomes (Y) causal framework and it seems to be the case using DoWhy/EconMl. For example, CausalForest may be a good candidate. My question is how would I define and pass parameters for both the Treatment and the Outcome when setting up the model? Would the below code work or will I run into issues?

model = CausalModel(data=df, treatment=["T1", "T2", "T3"], outcome=["Y1", "Y2"], common_causes=["W1", "W2", "W3"])

Also, I want to ensure that my treatments can be all continuous variables between 0 - 10 for example? Lastly, can you reference a good example notebook where I can see the predicted CATE for each instance (i.e. user) with each treatment combination(T1, T2, T3)? Something like this output:

user_id | T1 | T2 | T3   | CATE Y1  | CATE Y2
1       | 4  | 0  | 0    | 0.2      | 0.1
1       | 1  | 6  | 1    | 0.22     | 0.13
1       | 2  | 1  | 8    | 0.62     | -0.2
...

Any help is very appreciated.

titubs avatar Sep 11 '22 03:09 titubs

@emrekiciman do you want to field this one?

darthtrevino avatar Sep 11 '22 05:09 darthtrevino

@darthtrevino Thank you so much for routing this to the right person. I am so excited to hear back from @emrekiciman.

titubs avatar Sep 11 '22 19:09 titubs

Hi @titubs, here's an example notebook showing how to setup an analysis with multiple treatments. Does it answer your question? https://py-why.github.io/dowhy/v0.8/example_notebooks/dowhy_multiple_treatments.html

emrekiciman avatar Sep 11 '22 19:09 emrekiciman

@emrekiciman Thank you so much. This is helpful. The only aspect the notebook does not address is if how to specify multiple (continous outcomes or Ys). Can you please assist with that last aspect?

titubs avatar Sep 11 '22 20:09 titubs

@emrekiciman Sorry to bother again but I wonder if my last question reg. the multiple outcome aspect came trough?

titubs avatar Sep 13 '22 03:09 titubs

Hi @titubs , I don't think that multiple outcomes are supported directly. I'd recommend iterating through each of the outcome features and running the multiple treatment analysis for each outcome. I.e., running the analysis once for Y1 and separately again for Y2. Does that make sense in your scenario?

emrekiciman avatar Sep 13 '22 06:09 emrekiciman

@emrekiciman I found something that may work with EconML/Dowhy. I got to the point of creating an output like this:

Screen Shot 2022-09-13 at 9 33 33 PM

The issue I am having is to map the anonymized Ys and Ts into their actual values (I think these are the nuisance models to predict y and t). Essentially, I want to read from the df what explicit treatment combinations had what incremental impact on Y1 and Y2 (since I have two outcomes). I am not sure how to derive that from this output. Can you help?

titubs avatar Sep 14 '22 04:09 titubs

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

github-actions[bot] avatar Oct 29 '22 02:10 github-actions[bot]

We are wokring on adding better support for multiple treatments and outcomes in a future release. The API spec can be found here: https://github.com/py-why/dowhy/wiki/API-proposal-for-v1

amit-sharma avatar Nov 02 '22 09:11 amit-sharma

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

github-actions[bot] avatar Nov 18 '22 02:11 github-actions[bot]

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

github-actions[bot] avatar Nov 26 '22 02:11 github-actions[bot]