My question about the decomposition still stands though, how do I estimate
g in the model below when using fixed effects.
    y(it)=b*x(it) + g*z(i) + a(i) + e(it)
where x(it) are time varying characteristics, z(i) are time invariant
characteristics, and a(i) are the fixed effects.
One answer is that there is no fixed-effect estimator of g. In the 
fixed-effect (within) model the assumption is that every variable in X and 
Z is correlated with the (fixed) effect a(i). More formally, fixed-effect 
estimation is consistent whether those correlations exist or not, while 
random effects are only consistent (and efficient) if no explanatory 
variable is correlated with a(i). (I think this is well illustrated in 
William Gould's faq at My proposal is to estimate fixed effects model, predict a(i), then regress
a(i) on z.  I would bootstrap to get the standard errors right on the
auxilliary regression
     xtreg y x, fe
     predict a, u
     by id : keep if _n==1
     regress a z
Which connects with my second answer. Hausman and Taylor (1981) discuss in 
some detail the "fixed-effects" estimation of g and the model which would 
be estimated with the above code. They conclude that regressing the a(i) 
ressiduals on z(i) will only yield a consistent estimator of g if z(i) and 
a(i) are uncorrelated, and that is not the assumption under the 
fixed-effects approach. Besides, if that is the case, you would be better 
off with a random effects model -xtreg, fe- or, if some characteristics in 
x(i) are endogenous with respect to a(i), the appropiate -xthtaylor- 
specification. Further, they suggest a variation of your last regression 
(regress a z), but using an instrumental variable approach (where some or 
all the z's are assumed endogenous and at least that many x's have to be 
assume exogenous). a would be regressed on z, with the individual means of 
the exogenous x's as instruments. If, in your code, x is uncorrelated with 
a but you suspect z is, it would be someting like this: