Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: Obtaining fixed effects using the predict command ; sortingissues


From   "Thuy Le" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: Obtaining fixed effects using the predict command ; sortingissues
Date   Sun, 21 Aug 2005 22:00:38 -0400

Setting lag_invest = l.invest may do the trick but I suspect that the model
is no longer dynamic FE model.
Ky Tran
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Scott Merryman
Sent: Sunday, August 21, 2005 4:51 PM
To: [email protected]
Subject: st: RE: Obtaining fixed effects using the predict command ; sorting
issues

I suspect you are using time series operators (l.varname)?  Generate the
lagged variable before calling -xtreg- (see example below).  You might want
to pass this on to Stata tech support
(http://www.stata.com/support/tech-support/)

Hope this helps,
Scott


. webuse grunfeld

. qui xtreg invest l.invest mvalue kstock, fe

. predict u_hat, u
not sorted
r(5);

. gen lag_invest = l.invest
(10 missing values generated)

. qui xtreg invest lag_invest mvalue kstock, fe

. predict u_hat, u
(10 missing values generated)


> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Bob Rijkers
> Sent: Friday, August 19, 2005 4:28 AM
> To: [email protected]
> Cc: [email protected]
> Subject: st: Obtaining fixed effects using the predict command ; sorting
> issues
> 
> 
> To Whom It May Concern,
> 
> I am estimating a fixed-effects model on a dynamic panel using the xtreg,
> fe command. I would like to obtain an estimate of the fixed effects. When
> I use the predict command (with option ,u for fixed effects) I get an
> error message telling me the data are not sorted. However, simply sorting
> the data by panel-variable and time-variable does not resolve the issue.
> My question is; what am I doing wrong? Or; how do I sort my data?
> 
> Sincerely,
> 
> Bob Rijkers
> 
> PS Obviously,  I could compute the fixed effects in a more roundabout
> fashion by calculating fitted values (the predict command does enable me
> to obtain fitted values), and computing the mean residual, but I have the
> gut feeling there must be an easier way of obtaining the fixed effects.
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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