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   smerryman@kc.rr.com
To   statalist@hsphsun2.harvard.edu
Subject   Re: RE: st: graphs linear regressions with dummies
Date   Tue, 09 Nov 2004 15:44:32 -0600

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.

Scott


----- Original Message -----
From: Nick Cox <n.j.cox@durham.ac.uk>
Date: Tuesday, November 9, 2004 9:09 am
Subject: RE: st: graphs linear regressions with dummies

> 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. 
> 
> Nick 
> n.j.cox@durham.ac.uk 


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