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

Inconsistent ATE estimation #860

Closed
ellpri opened this issue Mar 8, 2024 · 3 comments
Closed

Inconsistent ATE estimation #860

ellpri opened this issue Mar 8, 2024 · 3 comments

Comments

@ellpri
Copy link

ellpri commented Mar 8, 2024

I tried the usecase mentioned in DoubleML Impact of 401k. In DoubleML, they arrived at a conclusion saying that that participation on the pension scheme has a significant positive effect on financial assets. I also got similar results mentioned by them.

But when i tried to reproduce the same example using EconML, i get a negative treatment effect

from doubleml.datasets import fetch_401K
data = fetch_401K(return_type='DataFrame')
X = data[['age', 'p401', 'educ', 'fsize', 'marr','twoearn', 'db', 'pira', 'hown']].values
Y = data['net_tfa'].values
T = data['e401'].values
X_train, X_test, y_train, y_test, T_train, T_test = train_test_split(X, Y, T, test_size=0.2, random_state=42)
est_401 = CausalForestDML(model_y=RandomForestRegressor(),
                model_t=RandomForestClassifier(min_samples_leaf=10),
               discrete_treatment=True, cv=3
                )
est_401.fit(y_train, T_train, X=X_train, W=None, cache_values=True)
print(est_401.ate(X, T0=0, T1=1))
print(est_401.ate_interval(X,T0=0, T1=1))

Output:
-3561.8794269648424
(-55233.03792924924, 48109.27907531955)

I also tried DML, NonParamDML apart from CausalForestDML but got same negative results. Please could anyone point out what am i doing wrong here?

@ellpri ellpri closed this as completed Mar 12, 2024
@ellpri
Copy link
Author

ellpri commented Mar 12, 2024

I got the results as expected.

@kbattocchi
Copy link
Collaborator

@ellpri I'm glad you were able to resolve it - out of curiosity is there anything about our API that made it confusing that we could change to prevent this kind of issue in the future?

@ellpri
Copy link
Author

ellpri commented Mar 13, 2024

@kbattocchi Hi, no problem with the API. Somehow I wrongly accessed the input values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants