Graph with Fitted Values

The fitted values graph features a line of best fit and data points. The difference in colours and clarity of the line and range means the graph is legible, and can be easily interpreted.

The following code can be used to create the fitted values graph in Stata:

sysuse auto, clear
regress mpg weight
generate x = weight
sort x
twoway (lfit mpg weight, lwidth(vthick)) (function y = _b[weight]*x+_b[_cons], range(0 8000)) (scatter mpg weight)