mcaceresb / stata-honestdid

Robust inference in difference-in-differences and event study designs (Stata version of the R package of the same name)
79 stars 18 forks source link

Issue with one post-treatment period and RM restriction? #17

Closed jonathandroth closed 8 months ago

jonathandroth commented 8 months ago

Does the issue raised with the R package here also affect the Stata package?

mcaceresb commented 8 months ago

@jonathandroth Yes.

jonathandroth commented 8 months ago

Thanks. I think the fix for you should be easier because you only have rm and not its variants rmm, rmb, etc

On Tue, Jan 16, 2024 at 1:54 PM Mauricio Caceres Bravo < @.***> wrote:

@jonathandroth https://github.com/jonathandroth Yes.

— Reply to this email directly, view it on GitHub https://github.com/mcaceresb/stata-honestdid/issues/17#issuecomment-1894332925, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE6EXFFOSPWDY6TMI6RAJYDYO3EFPAVCNFSM6AAAAABB5JOYV2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJUGMZTEOJSGU . You are receiving this because you were mentioned.Message ID: @.***>

mcaceresb commented 8 months ago

@jonathandroth Merged in #18. I also added a warning if sigma is not symm PSD.

Btw it seems that when it got an odd sigma, R computed quantiles by ignoring missing values, whereas Stata gave a missing value and let the rest of the function continue out as if the entire thing had failed. I'm taking about this function. As part of this PR I'm making both packages behave more similar to each other.

jonathandroth commented 8 months ago

Thanks, Mauricio! Just to make sure I understand, you're talking about a case where the user-provided variance-covariance matrix has some entries = NA? If so, I think in this case we should probably just throw an error.

On Thu, Feb 1, 2024 at 4:44 PM Mauricio Caceres Bravo < @.***> wrote:

@jonathandroth https://github.com/jonathandroth Merged in #18 https://github.com/mcaceresb/stata-honestdid/pull/18. I also added a warning if sigma is not symm PSD.

Btw it seems that when it got an odd sigma, R computed quantiles by ignoring missing values, whereas Stata gave a missing value and let the rest of the function continue out as if the entire thing had failed. I'm taking about this function https://github.com/asheshrambachan/HonestDiD/blob/master/R/arp-nuisance.R#L351. As part of this PR I'm making both packages behave more similar to each other.

— Reply to this email directly, view it on GitHub https://github.com/mcaceresb/stata-honestdid/issues/17#issuecomment-1922300498, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE6EXFE5AEAGGBIRJQYFCGLYRQEERAVCNFSM6AAAAABB5JOYV2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRSGMYDANBZHA . You are receiving this because you were mentioned.Message ID: @.***>

mcaceresb commented 8 months ago

@jonathandroth No, I accidentally found some cases where the vcov matrix has all non-missing values but some iterations inside "find least favorable cv" fail. The function in R reports a quantile by dropping missings, basically, and now I'm doing the same here.

jonathandroth commented 8 months ago

Got it. The LF critical value runs ~1000 linear programs and I think sometimes there is some numerical precision error such that these fail to converge. Dropping the missings is fine with me.

On Thu, Feb 1, 2024 at 7:01 PM Mauricio Caceres Bravo < @.***> wrote:

@jonathandroth https://github.com/jonathandroth No, I accidentally found some cases where the vcov matrix has all non-missing values but some iterations inside "find least favorable cv" fail. The function in R reports a quantile by dropping missings, basically, and now I'm doing the same here.

— Reply to this email directly, view it on GitHub https://github.com/mcaceresb/stata-honestdid/issues/17#issuecomment-1922514340, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE6EXFFJORD74Q6M3PD6DFLYRQUERAVCNFSM6AAAAABB5JOYV2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRSGUYTIMZUGA . You are receiving this because you were mentioned.Message ID: @.***>