Dear Statlisters,
I have a question about the use of REGHDFE, created by Sergio Correira. I am using Stata12.
Suppose I have an employer-employee linked panel dataset that looks something like this:
Year Worker_ID Firm_ID X1 X2 X3 Wage
1992 1 3 2 2 2 15
1993 1 3 3 3 3 20
1994 1 4 2 2 2 50
1995 2 51 10 7 7 28
where X1, X2, X3 are worker characteristics (age, education etc).
I want to estimate a two-way fixed effects model such as:
wage(i,t) = x(i,t)b + workers fe + firm fe + residual(i,t)
I use the command to estimate the model:
reghdfe wage X1 X2 X3, absvar(p=Worker_ID j=Firm_ID)
I then check:
predict xb, xb
predict res, r
gen yhat = xb + p + j + res
and find that yhat ≠ wage.
MY QUESTION: Why is it that yhat ≠ wage?
However, the following produces yhat = wage:
capture drop yhat
predict xbd, xbd
gen yhat = xbd + res
Now, yhat=wage
What is the difference between xbd and xb + p + f? What is it in the estimation procedure that causes the two to differ?
Thanks in advance!
Nicky
I have a question about the use of REGHDFE, created by Sergio Correira. I am using Stata12.
Suppose I have an employer-employee linked panel dataset that looks something like this:
Year Worker_ID Firm_ID X1 X2 X3 Wage
1992 1 3 2 2 2 15
1993 1 3 3 3 3 20
1994 1 4 2 2 2 50
1995 2 51 10 7 7 28
where X1, X2, X3 are worker characteristics (age, education etc).
I want to estimate a two-way fixed effects model such as:
wage(i,t) = x(i,t)b + workers fe + firm fe + residual(i,t)
I use the command to estimate the model:
reghdfe wage X1 X2 X3, absvar(p=Worker_ID j=Firm_ID)
I then check:
predict xb, xb
predict res, r
gen yhat = xb + p + j + res
and find that yhat ≠ wage.
MY QUESTION: Why is it that yhat ≠ wage?
However, the following produces yhat = wage:
capture drop yhat
predict xbd, xbd
gen yhat = xbd + res
Now, yhat=wage
What is the difference between xbd and xb + p + f? What is it in the estimation procedure that causes the two to differ?
Thanks in advance!
Nicky
Comment