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   [email protected]
To   [email protected]
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 <[email protected]>
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 
> [email protected] 


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