Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: RE: bys var: regression and predict??
From
Nick Cox <[email protected]>
To
"'[email protected]'" <[email protected]>
Subject
st: RE: bys var: regression and predict??
Date
Mon, 4 Apr 2011 10:54:50 +0100
-predict- does work in the usual way. The usual way is that -predict- works with the last model estimated, which is in your case for the last value of -splitting_var-.
Clearly, however, this is not what you want. You could look at -statsby- or you could write code to save predictions one by one.
Nick
[email protected]
Darjusch
I would like to estimate a model on sub-sets of data using
bys splitting_var: regress y x1 x2 x3
and then predict (and plot) y at different values of x1 while holding x2
and x3 constant at their mean values.
apparently -predict- does not work in the usual way after "bys
splitting_var: regress"
Is there any convenient way to do this?
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/