lrberge / fixest

Fixed-effects estimations
https://lrberge.github.io/fixest/
361 stars 59 forks source link

Feature request: CCV and TSCB clustered SE #471

Open fa-rzam opened 4 months ago

fa-rzam commented 4 months ago

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

s3alfisc commented 4 months ago

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 commented 4 months ago

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.

lrberge commented 4 months ago

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.

s3alfisc commented 4 months ago

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.

fa-rzam commented 4 months ago

@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!

s3alfisc commented 4 months ago

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 =)

fa-rzam commented 4 months ago

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!

s3alfisc commented 3 months ago

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