On Fri, 18 Dec 2015, Allin Cottrell wrote:
Now let's consider the random-effects model. This can be
represented as
y_{it} = \mu + X_{it}\beta + u_i + e_{it}
In this case gretl considers the "error term" to be u_i + e_{it}
(since u_i is conceived as a random drawing) and the $uhat series
is the estimate of this, namely (taking "hats" as implicit,
please)
y_{it} - \mu - X_{it}\beta
which corresponds to Stata's "predict, ue". What if you want an
estimate of just e_{it} (or just u_i) in this case? That's more
difficult, since random-effects estimation in itself does not
require estimation of the u_i in their own right. [...] Stata
offers "predict, e" and "predict, u" but it's not clear how they
are calculating these. [...]
If there's a reasonably uncontroversial way to recover estimates of
the u_i it would be nice to mention that in the doc. A simple (too
simple?) way would be just to take the individual means of the
composite residuals, as in
series ui = pmean($uhat)
However, that does not agree with Stata. After a little bumbling
around it became apparent that, given a balanced panel, the Stata
ui values differ from the above by a multiplicative constant, and
after a bit more trial and error it emerged that the constant is
1 - (1 - \theta)^2
where \theta is the GLS coefficient. So (for a balanced panel) we
have
ui_stata = (1 - (1 - theta)^2) * pmean($uhat)
Can anyone supply an econometric rationale for that formula? (I
don't want to put something in the doc whose only rationale is that
it's what Stata seems to be doing!)
Allin Cottrell