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

st: predict when using by for regress


From   "Helena Schweiger" <[email protected]>
To   <[email protected]>
Subject   st: predict when using by for regress
Date   Sun, 14 Mar 2004 19:49:34 -0500

Hi all,

My dataset has three dimensions (country, year, firm) and I'm estimating
total factor productivity (using OLS estimates as a reference for more
appropriate estimation techniques) by country and year. I want to get
the estimated values of log of output, so that I can calculate log of
TFP, but if I use predict after my regress command - which would look
for example like this: 
sort country year; 
by country year: regress lnoutput lnl lnk lnm;
predict hlnoutput, xb;

- it uses the coefficients estimated in the last country-year pair,
which is not what I want. There probably is a way to do this (other than
writing down the equations for each country-year pair to get the
estimated values which is very time-consuming, since all the
coefficients need to be typed for each pair), but I cannot find it.
Could you please help?

Thanks,
Helena
*
*   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