The points , and lie on .
The points , and lie on . What least-squares slope does the formula return?
Worked answer
The means are and . Then and , so the slope is and the intercept is . The residuals are zero.
The points (0,1), (1,3) and (2,5) lie on Y=1+2x. What least-squares slope does the formula return?
The means are x=1 and Y=3. Then Sxx=2 and SxY=4, so the slope is 4/2=2 and the intercept is 3−2⋅1=1. The residuals are zero.