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

st: Re: xtreg


From   baum <[email protected]>
To   [email protected]
Subject   st: Re: xtreg
Date   Wed, 03 Jul 2002 16:26:49 -0400

--On Tuesday, July 2, 2002 2:33 -0400 Mona wrote:

I use the procedure xtreg, fe to make a fixed effects estimation. I have
got a panel data set that consists of 500 individuals. I have information
about two years (year1 and year2) for each person. In the long form this
data consists of 1000 observations. That is, the number of observations
in the fixed effects estimation is 1000. Afterwards, I want to predict
u(i) to get a single value  for each person. Right now I get a value for
each observation. That is, u(i)-year1 and u(i)-year2. How do I get a
single value for each person?
Why not predict if year==1 (or if year==2)? I'm not sure what you're trying to do; there are as many in-sample predicted values as there are observations, as there would be in any regression. Do you mean you want the average prediction by individual? Then just generate the standard prediction and collapse on the year variable; that will generate a new data set with 500 obs., each the average of y-hat for an individual.

Kit Baum
*
* 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