Question

11. [-13.22 Points] DETAILS LARLINALG8 2.6.017. Consider the following. 5 (1,5) 4 (2, 4) 3 2 (2, 2) (3, 1) - Х - 1 2 3 4 -14(a) Sketch the line that appears to be the best fit for the given points.

(b) Find the least squares regression line. y(x)=

(c) Calculate the sum of squared error.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

(a)

The figure below illustrates a scatter plot and a line of best fit.

The equation of the line is, y = mx + c , where m is the slope of the line, and c is the y-intercept.

The line passes through the points, A(1,5), and, B(3,1).

Slope, m=\frac{5-1}{1-3}

i.e., m=-2

Therefore the equation of the line becomes, y=-2x+c

The above line passes through the point, A(1,5). Using the co-ordinates of the point A(1,5), in the above, equation of the line, we have,

5=(-2)(1)+c

i.e., c=7

Substituting the value of, c=7 in the above, equation of the line, we have, the equation of the line,

y=-2x+7

The equation of the line of best fit, is, y=-2x+7 .

7 CO -5 +3 N -4 -3 -2 -1 0 2 3 4 5 6 00 9 10 1

(b)

The least squares regression line is given by the formula,

\hat{y}=b_0+b_1x,

Its slope bi and y-intercept b_0 are computed using the formulas, b_1=\frac{SS_{xy}}{SS_{xx}} , and, b_0=\bar{y}-b_1\bar{x} , where,

SS_{xx}=\sum x^2-\frac{1}{n}\left ( \sum x \right )^2, SS_{xy}=\sum xy-\frac{1}{n}\left ( \sum x \right )\left ( \sum y \right )

T is the mean of all the x-values, \bar{y} is the mean of all the y-values, and n is the number of pairs in the data set.

x y x^2 xy
1 5 1 5
2 2 4 4
2 4 4 8
3 1 9 3
\sum 8 12 18 20

In the last line of the table above, we have the sum of the numbers in each column. Using them we compute:

SS_{xx}=\sum x^2-\frac{1}{n}\left ( \sum x \right )^2=18-\frac{1}{4}(8)^2=2

SS_{xy}=\sum xy-\frac{1}{n}\left ( \sum x \right )\left ( \sum y \right )=20-\frac{1}{4}(8)(12)=-4

\bar{x}=\frac{\sum x}{n}=\frac{8}{4}=2

\bar{y}=\frac{\sum y}{n}=\frac{12}{4}=3

and we now have,

b_1=\frac{SS_{xy}}{SS_{xx}}=\frac{-4}{2}=-2

Using the value of b_1=-2 , \bar{x}=2 , and, \bar{y}=3 in the equation of the least squares regression line, we have, b_0=\bar{y}-b_1\bar{x}=3-(-2)(2)=7

We now have the least squares regression line for given data and it is, \hat{y}=7-2x

(c)

We now calculate the sum of squared error.

\textup{SSE}=\sum_{i=1}^{n}(x_i-\bar{x})^2

T y x_i-\bar{x}=x_i-2 (x_i-\bar{x})^2
1 5 -1 1
2 2 0 0
2 4 0 0
3 1 1 1
\sum 8 12 0 2

\textup{SSE}=\frac{(x_1-2)^2+(x_2-2)^2+(x_3-2)^2+(x_4-2)^2}{4}

i.e., \textup{SSE}=\frac{(1-2)^2+(2-2)^2+(2-2)^2+(3-2)^2}{4}

i.e., \textup{SSE}=\frac{1+0+0+1}{4}

i.e., \textup{SSE}=\frac{2}{4}=\frac{1}{2}

Add a comment
Know the answer?
Add Answer to:
(a) Sketch the line that appears to be the best fit for the given points. (b)...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT