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

st: Fitting line in regressions


From   "Nick Winter" <[email protected]>
To   <[email protected]>
Subject   st: Fitting line in regressions
Date   Wed, 29 Jan 2003 16:04:11 -0500

> -----Original Message-----
> From: Louise Hiley [mailto:[email protected]] 
> Sent: Wednesday, January 29, 2003 3:59 PM
> To: [email protected]
> Subject: 
> 
> 
> Dear all,
> 
> Is it possible to include a regression line in a two-way 
> scatter plot? I use 
> Stata 6, but will soon upgrade to Stata 8.
> 
> Best regards,
> 
> /Louise

In Stata 8:

	. twoway (scatter mpg price) (lfit mpg price)

In Stata 6:

	. regress mpg price
	. predict mpg_hat
	. graph mpg mpg_hat price , c(.l) s(oi) sort

--Nick Winter

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