Unfortunately, my data is confidential so I cannot post it here, but I ran three different regressions with an unbalanced panel dataset of individuals over 20 months.
Then I demeaned hoursworked and age by ID and ran:
These two regressions provided the same coefficients.
But then I did
I have got very similar coefficients but not exactly the same, there was a slight difference.
Anyone knows why something like this would occur? I thought these approaches were equivalent.
Code:
areg hoursworked age, a(ID)
Code:
reg hoursworkeddemeaned agedemeaned
But then I did
Code:
xtset ID xtreg hoursworked age, fe
Anyone knows why something like this would occur? I thought these approaches were equivalent.
Comment