[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: extracting or displaying the vector of fixed effects after xtreg

From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: extracting or displaying the vector of fixed effects after xtreg
Date   Tue, 22 Jan 2008 09:09:33 +0000 (GMT)

--- Lloyd Dumont <[email protected]> wrote:
> I have been running xtreg on longitudinal data that 
> contains a small number of clusters relative to time 
> periods.  I thought that if I ran an FE model with a 
> few time-varying predictors, it might be useful for 
> me to eyeball each cluster's FE.  In fact--even 
> better--I would love to run xtreg, fe in a way that 
> lets me get rid of the (shared) constant, keep all 
> (rather than all minus one) of the FEs, and actually 
> display the fixed-effects in the output.

This functionality already exist, but only as part of
-predict-. I think that that is the right place for it,
this way it is useful for both people with a small 
number of clusters and for people with a large number of 
clusters. Displaying a table of fixed effects is not
nice in the latter case, but you might want to look at
a graph. See -help xtreg postestimation- and the example 
below (sorry, I could not resist some self-promotion and
used my -hangroot- package downloadable from -ssc- near
the bottom of that example)

*------------------- begin example ----------------------
webuse nlswork, clear
generate age2 = age^2
generate ttl_exp2 = ttl_exp^2
generate tenure2 = tenure^2
generate byte black = race==2
xtreg ln_w grade age* ttl_exp* tenure* ///
           black not_smsa south union, i(idcode) fe
predict u, u
bys idcode (u) : gen first = _n == 1
list idcode u if first
hangroot u if first, dist(Gaussian)
*--------------- end example -----------------------------
(For more on how to use examples I sent to the Statalist, see )

Hope this helps,

Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

Support the World Aids Awareness campaign this month with Yahoo! For Good
*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index