tomzylkin / ppml_fe_bias

bias corrections for PPML estimation of two-way and three-way fixed effects models
9 stars 0 forks source link

R Package #1

Open ChristianDueben opened 2 years ago

ChristianDueben commented 2 years ago

Dear Martin Weidner and Thomas Zylkin,

Do you plan on publishing your code as an R package (with functions implemented in C++)? My co-authors and I find your error correction quite interesting and are applying it in a paper of ours. Unfortunately, the function sometimes runs an hour or two when using large data and FEs based on variables with lots of categories. Translating code from Stata to R often drastically speeds up computations.

If you are unfamiliar with R and C++, we could assist with the translation.

Thank you for considering the request.

Kind regards, Christian Düben

tomzylkin commented 2 years ago

Hi Christian, Thanks for your message and your interest in our work! I have indeed been working on an R version of the ppml_fe_bias command, but I had to drop it earlier this year to work on other things and have not been able to pick it up since. Currently I am on paternity leave and taking a break from research-related tasks, but I would certainly welcome the help if you are offering to assist.

As an aside, you could also look onto jackknife- and/or bootstrap-based solutions to the issues we raise in the paper. Aside from the SPJ approach we try out in the paper, there is further discussion in Fernandez-val and Weidner Annual Reviews 2018 and Pfaffermayr Economics Letters 2021. These papers look at two way models, but the arguments should flow through if one thinks about pairs as the unit to be resampled rather than individual observations.

Regards, Tom

ChristianDueben commented 2 years ago

Dear Tom,

Thanks for the nice response. I have to admit that I did not venture deep into the econometric details yet. What I can do at some point in the next few weeks, is to translate the current Stata package and upload it to Github. You could then inspect it, adding or suggesting any extension you like.

Kind regards, Christian

tomzylkin commented 2 years ago

Hi Christian, Sorry for the delay in response! As I mentioned, it is hard to keep up things for me at the moment. Thanks very much for the very kind offer. I will email you separately so we can discuss. Regards, Tom