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

Errors in standard error of estimate and student's t test #2

Open
MrZhihao opened this issue Mar 20, 2019 · 7 comments
Open

Errors in standard error of estimate and student's t test #2

MrZhihao opened this issue Mar 20, 2019 · 7 comments

Comments

@MrZhihao
Copy link

Hello,

When I used "wfe" package to figure out some DID question, there were some errors appeared. The results of Std.Err, t value and Pr displayed "NA" and there was a warning message-"Warning message: In sqrt(diag(vcov.wfe)) : NaNs produced".

Could someone please help me find the way to deal with these errors?
Thanks a lot!

PS: the number of the data I used seems a little bit large and it's over 40,000 items.

@insongkim
Copy link
Owner

Thank you very much for using the package. Could you check whether there is at least one treated and control observation within each unit and time? Another reason why this could happen is when there exists perfect collinearity. Could you check whether one of the covariates in your model is a linear combination of others?

@MrZhihao
Copy link
Author

Thank you for your answer. I guess these errors may be because there is not treated observation in some units.

However, I still have a question that why we should ensure that each unit in the control group have at least one item treated.

Looking forward to your further response.
Thx again!

@insongkim
Copy link
Owner

insongkim commented Mar 20, 2019

Thanks. It is not necessarily a problem. However, if there exist variables that also don't vary within the unit, then I think the perfect collinearity issue arises. Thus, in general, we recommend users to ensure that there are no time-invariant covariates.

@MrZhihao
Copy link
Author

I'm a little confused. Actually in my case, there are some units that just have all 0 treatment variate. And I could ensure that except treatment variate, covariates are all time-invariant.

@insongkim
Copy link
Owner

Could you send me the code/data so that I can reproduce your error? I will look into it. Thanks.

@MrZhihao
Copy link
Author

It's great. My code is as follow:
modSingle.did <- wfe(Vol~ Treat+TrancPortion+MovPortion, data = finalPriceData, treat = "Treat", unit.index = "Stkcd", time.index = "Trddt", method = "unit", qoi = "ate", estimator ="did", hetero.se=TRUE, auto.se=TRUE, White = TRUE, White.alpha = 0.05, verbose = TRUE)

But the data is over 2MB, could you give me your email or other way so that I could send it?

Thanks for your help.

@insongkim
Copy link
Owner

@Deo-Ned please send the files to insong@mit.edu Thanks.

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