Also checkout
1. -twoway lfit- in official Stata
2. -modeldiag-, a user-written package
(use -search- to find location)
With 2., see e.g. -regplot- within -modeldiag-.
For example, suppose you
sysuse auto, clear
gen gpm = 1/mpg
regress gpm weight
regplot
-regplot- works on the last regression-type results. By
default you get a scatter plot of the response versus
the (first) predictor named, plus a smooth curve
of the just fitted relationship.
Nick
[email protected]
Svend Juul
> Jagath wants to draw a scatter diagram with a trend line on it
> -------------------------------------------
>
> You can combine two or more plots in a single graph. Try this:
>
> clear
> sysuse auto.dta
> twoway (scatter mpg weight)(lfit mpg weight)
>
> This gives the linear regression estimate. A smooth Lowess curve is
> drawn by:
>
> twoway (scatter mpg weight)(lowess mpg weight)
>
*
* 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/