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

RE: RE: st: graphs linear regressions with dummies


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: RE: st: graphs linear regressions with dummies
Date   Wed, 10 Nov 2004 11:41:37 -0000

Agreed. If it is important to extrapolate beyond 
the estimation sample, you need to do that 
yourself with -predict- calls, as in your original 
posting. I personally prefer to emphasise the range 
of the data on which the fit is based, but other 
emphases have their own logic. 

Nick 
n.j.cox@durham.ac.uk 

smerryman@kc.rr.com
 
> One minor problem with using -separate- is that the dummy 
> variables may not
> match range of the explanatory variable.
> 
> For example,
> 
> sysuse auto,clear
> xi: reg price mpg i.rep
> predict fit
> separate fit, by(rep) veryshortlabel 
> twoway line fit? mpg,  ytitle(Predicted Price)
> 
> will produce rather short lines for the dummy variables, 
> which may not be desired.

Nick Cox 
 
> > To follow up my previous posting, you 
> > can do this with less typing (and without changing
> > your existing variables) 
> > 
> > sysuse auto,clear
> > reg price mpg fore
> > predict fit
> > separate fit, by(foreign) veryshortlabel 
> > twoway line fit? mpg, clcolor(blue green) 
> > 	ytitle(Predicted Price)
> > 
> > The -veryshortlabel- option is undocumented, 
> > but helpful here. 
> > 

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index