Hi all,
I've been using the -xtreg- to estimate the first-stage of a 2SLS model, but switched to -reghdfe- because of faster run-time and better compatibility with Stata 13.
One issue I'm running into is differences in how the within r-squared is calculated in fixed-effects model.
Here is the code I'm running:
As I understand it, the within r-squared should be the same for both models. But it isn't. The r-squared I'm getting for -xtreg- is 0.49, while it's about 0.07 for -reghdfe-.
Any suggestions for identifying the discrepancy?
I've been using the -xtreg- to estimate the first-stage of a 2SLS model, but switched to -reghdfe- because of faster run-time and better compatibility with Stata 13.
One issue I'm running into is differences in how the within r-squared is calculated in fixed-effects model.
Here is the code I'm running:
Code:
xtset id year xtreg y x i.year, vce(cluster id) fe tsset id year reghdfe y x, vce(cluster id) absorb(id year)
Any suggestions for identifying the discrepancy?
Comment