fixest icon indicating copy to clipboard operation
fixest copied to clipboard

Feature request: CCV and TSCB clustered SE

Open fa-rzam opened this issue 1 year ago • 8 comments

Hello,

First, let me start by saying how much love this package. Thank you for all you've done!

I was hoping that you could also consider implementing the two clustered SE explained in this QJE paper by Jeff Wooldridge and his colleagues.

https://economics.mit.edu/sites/default/files/2022-09/When%20Should%20You%20Adjust%20Standard%20Errors%20for%20Clustering.pdf

Thanks, Farzam

fa-rzam avatar Feb 12 '24 17:02 fa-rzam

Hi @fa-rzam, I have started to work on a Python implementation of the CCV estimator. I will prepare a PR for fixest once I am done (hopefully today) and in case @lrberge is interested in adding it to fixest =)

s3alfisc avatar Feb 18 '24 09:02 s3alfisc

I have set up a first Python translation, which should be very easy to port to R. You can find it here. There is still a bug somewhere in there I am struggling to find. Once I catch it, I'll prepare the R version.

s3alfisc avatar Feb 18 '24 16:02 s3alfisc

Hi everyone, and thanks Alex for writing this up.

I have plans (always delayed though) to write guidelines on how to add new VCOVs into fixest. The current infrastructure makes it pretty easy, but I need to write a step-by-step guide.

lrberge avatar Feb 20 '24 10:02 lrberge

I think I've now gotten the method to work. @fa-rzam, do you happen to have access to a Stata license, and if yes, would you be up to run a couple of regressions for me to test my Python implementation of the CCV estimator? Once I am confident that it works I'll move on to translating it to R.

s3alfisc avatar Feb 25 '24 10:02 s3alfisc

@s3alfisc thank you very much for working on this. Yes, I can do that. Please let me know how I can help. I can see that you've been doing some testing against the Stata package already. Thanks!

fa-rzam avatar Feb 25 '24 15:02 fa-rzam

Thanks for offering your help! Though it is no longer needed, as @kylebutts was so kind to already help me with this. Would you feel confident to try the R translation yourself? Else I will give this a go next week =)

s3alfisc avatar Feb 25 '24 15:02 s3alfisc

Thank you @s3alfisc and @kylebutts! I wished I could say yes, but I am affraid that I don't know the fixest / pyfixest packages well enough to do the translation. It'd be better if I leave this to the hands of experts. Thank you!

fa-rzam avatar Feb 25 '24 16:02 fa-rzam

Update here - I'll try to code this up over the Easter break =)

s3alfisc avatar Mar 26 '24 17:03 s3alfisc