I have two issues related to running xtewreg (Erickson, Jiang, Whited, 2014, errors-in-variables remedy) that I cannot seem to resolve:
1. At the bottom of the xtewreg help file (http://www.haghish.com/statistics/st...d/xtewreg.html) is the following disclaimer:
"As XTEWreg requires de-meaned data (and does not compute fixed effects internally), the researcher must de-mean the data appropriately before using XTEWreg."
I have no problem demeaning the data on one dimension (i.e., id), but I also need to demean the data by another dimension (i.e., time). I've read this post (https://www.statalist.org/forums/for...s-do-not-match) on demeaning variables, and I can obtain the correct coefficients if I follow #3. I also need to obtain an accurate within r-squared (rho-squared in the case of xtewreg), but adding demeaned year dummies biases the rho-squared upwards. Essentially I need to demean my data on two dimensions without adding dummy variables in my regression that will bias the within r-squared upwards.
2. The second issue is with respect to clustering standard errors. xtewreg seems to only allow clustering errors on one dimension, depending on how the panel is defined (either by id and time or just by time), but I would really prefer to cluster on both dimensions. Does anyone have any suggestions on how to accomplish this? Does xtewreg even have that functionality?
Thanks,
Mike
1. At the bottom of the xtewreg help file (http://www.haghish.com/statistics/st...d/xtewreg.html) is the following disclaimer:
"As XTEWreg requires de-meaned data (and does not compute fixed effects internally), the researcher must de-mean the data appropriately before using XTEWreg."
I have no problem demeaning the data on one dimension (i.e., id), but I also need to demean the data by another dimension (i.e., time). I've read this post (https://www.statalist.org/forums/for...s-do-not-match) on demeaning variables, and I can obtain the correct coefficients if I follow #3. I also need to obtain an accurate within r-squared (rho-squared in the case of xtewreg), but adding demeaned year dummies biases the rho-squared upwards. Essentially I need to demean my data on two dimensions without adding dummy variables in my regression that will bias the within r-squared upwards.
2. The second issue is with respect to clustering standard errors. xtewreg seems to only allow clustering errors on one dimension, depending on how the panel is defined (either by id and time or just by time), but I would really prefer to cluster on both dimensions. Does anyone have any suggestions on how to accomplish this? Does xtewreg even have that functionality?
Thanks,
Mike
Comment