The points (0,1)(0,1), (1,3)(1,3) and (2,5)(2,5) lie on Y=1+2xY=1+2x.

The points (0,1)(0,1), (1,3)(1,3) and (2,5)(2,5) lie on Y=1+2xY=1+2x. What least-squares slope does the formula return?

The means are x‾=1\overline x=1 and Y‾=3\overline Y=3. Then Sxx=2S_{xx}=2 and SxY=4S_{xY}=4, so the slope is 4/2=24/2=2 and the intercept is 3−2⋅1=13-2\cdot 1=1. The residuals are zero.