Fit a simple regression line

Problem

Fit the ordinary least-squares line y^=β^0+β^1x\hat y=\hat\beta_0+\hat\beta_1x to the three points (0,1),(1,2),(2,2)(0,1),(1,2),(2,2). Give the slope, intercept, prediction at x=3x=3, and the three residuals in data order.

Reveal answer or reference solution

Here xˉ=1\bar x=1, yˉ=5/3\bar y=5/3,

Sxx=(−1)2+02+12=2,S_{xx}=(-1)^2+0^2+1^2=2,

and

Sxy=(−1)(−2/3)+0(1/3)+1(1/3)=1S_{xy}=(-1)(-2/3)+0(1/3)+1(1/3)=1

Hence β^1=Sxy/Sxx=1/2\hat\beta_1=S_{xy}/S_{xx}=1/2 and β^0=yˉ−β^1xˉ=7/6\hat\beta_0=\bar y-\hat\beta_1\bar x=7/6. The prediction at 33 is 7/6+3/2=8/37/6+3/2=8/3. The fitted values are (7/6,5/3,13/6)(7/6,5/3,13/6), so the residuals y−y^y-\hat y are

(−1/6,1/3,−1/6)(-1/6,1/3,-1/6)
Outcome

Previous attempts

Loading attempts saved in this browser…

    Review Screening Results