132k views
1 vote
What is the equation for a straight line that would allow you to predict the value of Y from a given value of X. That is, calculate the value of "a" and the value of "b" and then substitute the 2 values into the generic equation (Y = a + bX) for a straight line. (Hint: calculate "b" first)

What is the equation for a straight line that would allow you to predict the value-example-1

1 Answer

5 votes

Answer:


m=-(13)/(20.8)=-0.625

Nowe we can find the means for x and y like this:


\bar x= (\sum x_i)/(n)=(16)/(5)=3.2


\bar y= (\sum y_i)/(n)=(35)/(5)=7

And we can find the intercept using this:


b=\bar y -m \bar x=7-(-0.625*3.2)=9

So the line would be given by:


y=-0.625 x +9

Explanation:

We have the following data:

X: 3,3,2,1,7

Y:6,7,8,9,5

We want to find an equationinf the following form:


y= bX +a


a=m=(S_(xy))/(S_(xx))

Where:


S_(xy)=\sum_(i=1)^n x_i y_i -((\sum_(i=1)^n x_i)(\sum_(i=1)^n y_i))/(n)


S_(xx)=\sum_(i=1)^n x^2_i -((\sum_(i=1)^n x_i)^2)/(n)

So we can find the sums like this:


\sum_(i=1)^n x_i = 3+3+2+1+7=16


\sum_(i=1)^n y_i =6+7+8+9+5=35


\sum_(i=1)^n x^2_i =72


\sum_(i=1)^n y^2_i =255


\sum_(i=1)^n x_i y_i =99

With these we can find the sums:


S_(xx)=\sum_(i=1)^n x^2_i -((\sum_(i=1)^n x_i)^2)/(n)=72-(16^2)/(5)=20.8


S_(xy)=\sum_(i=1)^n x_i y_i -\frac{(\sum_(i=1)^n x_i)(\sum_(i=1)^n y_i)}=99-(16*35)/(5)=-13

And the slope would be:


m=-(13)/(20.8)=-0.625

Nowe we can find the means for x and y like this:


\bar x= (\sum x_i)/(n)=(16)/(5)=3.2


\bar y= (\sum y_i)/(n)=(35)/(5)=7

And we can find the intercept using this:


b=\bar y -m \bar x=7-(-0.625*3.2)=9

So the line would be given by:


y=-0.625 x +9

User Charleyh
by
7.9k points