I am trying to "manually" compute a fixed-effects estimator by taking the
differences from means of all variables and then running reg on the
demeaned data. You may ask why in the world I would want to do that, but
that's for another post.
I have a panel of student-level data over three years. I demean the data
as follows:
gen d2_nrtrgain = nrtrgain - nrtrgain_m;
gen d2_charter = charter - charter_m;
gen d2_nschools = nschools - nschools_m;
gen d2_chgschl = chgschl - chgschl_m;
I then run the following models:
areg nrtrgain charter nschools chgschl,
absorb(student) ;
xtdata nrtrgain charter nschools chgschl, fe clear;
reg nrtrgain charter nschools chgschl;
The first and third models yield the same estimated coefficients (except
for the constant, of course), but the coefficients for the second model
(using reg on the demeaned variables) yields different results. However,
when I eliminate all observations with missing values for any of the
variables in the model, all three models yield identical estimated slope
coefficients.
I'm guessing the problem has something to do with how egen computes the
mean for each student when there are missing observations. I have read
through the manual and searched the archives, but still can't figure out
what is going on. Any help would be greatly appreciated.
Tim
Tim R. Sass
Professor Voice: (850)644-7087
Department of Economics Fax: (850)644-4535
Florida State University E-mail: [email protected]
Tallahassee, FL 32306-2180 Internet: http://garnet.acns.fsu.edu/~tsass