Binary outcome, and multiple binary treatments. #228
-
Hi all, I am currently trying to find the ATE of three binary treatments on a binary outcome. Which model would I use to do this? I know the DoubleMLIRM model can use binary treatments, but I can only use one binary treatment in the DoubleMLData d_cols paramter. Does anyone have a solution or any suggestions? Thanks in advance! Here is my code: ' Load the dataset into a pandas dataframe' 'Assuming df is your DataFrame' 'Convert 'Machine failure' to integer' 'One-hot encode categorical treatment variables' 'Correct the data type assignments' 'Define treatment, outcome, and covariates' outcome = 'Machine failure' 'Split the data into training and testing sets' 'Create a DoubleMLData object for training' 'Boosted Trees for classification' np.random.seed(123) irm_summary = dml_irm.summary print(irm_summary) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
Hi, the DoubleMLIRM Model is only available with a single treatment. For multiple treatments you have to fit several models seperately. |
Beta Was this translation helpful? Give feedback.
-
Thank you Mr. Klaassen, I very much appreciate your input. Currently I have created a function that uses your library to compute the ATE for various datasets, where the outcome and treatment variables could be continuous or binary. My function also includes a method to find the top n treatments if user is not aware of what may be an important factor to include in their treatment list. Would you like to inspect this functionality and potentially add this to your library? Thanks! |
Beta Was this translation helpful? Give feedback.
Your are correct that the
DoubleMLPLR
odel can handle binary treatments, but you should use two seperate models if you want to use binary and continious treatments. The reason would be that the learner forml_m
is either used as a regressor or classifier (see DoubleMLPLR).You can just define two
DoubleMLData
objects, where the first just uses the continuous treatments and add the binary treatments to the controlsx
. There you can use a regressor as learner forml_m
. Afterwards, use the binary treatments and instead add the continuous treatments to the controls. Then you should use a classifier as learner forml_m
.For binary treatments, you could also use the
DoubleMLIRM
model, but there…