Height predicting weight across 3 age groups
Code: regress weight age1 age2 height age1ht age2ht
1 Outputtable: _cons (5.601677)
sort age
by age: regress weight height
3 outputtables, 1 for every agegroup, 3th outputtable for age3: _cons (5.601677)
Source of the above codes: http://www.ats.ucla.edu/stat/stata/faq/compreg3.htm
I was able to replicate the same method for my data. However, when I started to use xtreg to account for fixed effects with the following 2 codes, the _cons aren't equal anymore.
xtreg weight age1 age2 height age1ht age2ht, fe (1 outputtable)
sort age
by age: xtreg weight height, fe (3 outputtables)
The regression outputs of _cons of the above 2 codes aren't equal
Could you tell me what the difference is between the 2 _cons of the 2 -xtreg- codes?
Even without the option -fe- there's a difference between the 2 -xtreg- codes based on _cons.
Comment