Here we can make a scatterplot of the variables write with readuse http://www.ats.ucla.edu/stat/stata/notes/hsb2
We can likewise show a graph showing the predicted values of write by read as shown below.graph twoway scatter write read
Having seen how to make these separately, we can overlay them into one graph as shown below.graph twoway lfit write read
And we can even show the fitted value with a confidence interval for the mean as shown below.graph twoway (lfit write read) (scatter write read)
graph twoway (lfitci write read) (scatter write read)
The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California.