Dear Stata Users,
Please help me to understand whether I am wrong. I am using the following regression to estimate residuals:
The value of residuals for idcode == 1 and year == 70 is -0.40762286. However, if I plug in the estimates that I got: Y_hat = 0,000749*20 + 1,650541 = 1,665521. Thus, residuals should equal: Y – Y_hat = 1,451214 - 1,665521 = -0,214307. This is different from what the program is giving. Am I wrong in my calculations or there is smth wrong with the code?
Please help me to understand whether I am wrong. I am using the following regression to estimate residuals:
Code:
use http://www.stata-press.com/data/r15/nlswork.dta sort idcode year reghdfe ln_wage hours, absorb(idcode year) vce(cluster idcode) residuals (dropped 550 singleton observations) (MWFE estimator converged in 7 iterations) HDFE Linear regression Number of obs = 27,917 Absorbing 2 HDFE groups F( 1, 4159) = 2.35 Statistics robust to heteroskedasticity Prob > F = 0.1257 R-squared = 0.6555 Adj R-squared = 0.5949 Within R-sq. = 0.0004 Number of clusters (idcode) = 4,160 Root MSE = 0.3030 (Std. Err. adjusted for 4,160 clusters in idcode) ------------------------------------------------------------------------------ | Robust ln_wage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- hours | .000749 .000489 1.53 0.126 -.0002097 .0017076 _cons | 1.650541 .0178933 92.24 0.000 1.615461 1.685621 ------------------------------------------------------------------------------ Absorbed degrees of freedom: -----------------------------------------------------+ Absorbed FE | Categories - Redundant = Num. Coefs | -------------+---------------------------------------| idcode | 4160 4160 0 *| year | 15 0 15 | -----------------------------------------------------+ * = FE nested within cluster; treated as redundant for DoF computation
Comment