Given the table:
Day Value
1 20.71
2 19.69
3 19.61
4 19.64
5 19.26
Given that the table represents the closing prices of stock ABC, let's find the equation of the linear regression that fits the data.
Where:
n(number of data) = 5
Apply the slope intercept form of a linear equation:
y = mx + b
Where m is the slope and b is the y-intercept
Let's find the sum of the x-values (Days)
1 + 2 + 3 + 4 + 5 = 15
Also, sum up the y-values:
20.71 + 19.69 + 19.61 + 19.64 + 19.26 = 98.91
Sum of the products of the values of x and y.
We have:
[tex]\begin{gathered} \sum ^{}_{}xy=(1\ast20.71)+(2\ast19.69)+(3\ast19.61)+(4\ast19.64)+(5\ast19.26) \\ \\ \sum ^{}_{}xy=293.78 \end{gathered}[/tex]
Sum up the values of the square of x
[tex]\begin{gathered} \sum ^{}_{}x^2=1^2+2^2+3^2+4^2+5^2 \\ \\ \sum ^{}_{}x^2=55 \end{gathered}[/tex]
Sum up the values of the square of y:
[tex]\begin{gathered} \sum ^{}_{}y^2=20.71^2+19.69^2+19.61^2+19.64^2+19.26^2 \\ \\ \sum ^{}_{}y^2=1957.83 \end{gathered}[/tex]
Let's find the slope, m:
[tex]\begin{gathered} m=\frac{n(\sum^{}_{}xy)-\sum^{}_{}x\sum^{}_{}y}{n(\sum^{}_{}x^2)-(\sum^{}_{}x)^2} \\ \\ m=\frac{5(293.8)-(15)(98.91)}{5(55)-(15)^2} \\ \\ m=-0.297 \end{gathered}[/tex]
To find the y-intercept (b), apply the formula:
[tex]b=\frac{(\sum ^{}_{}y)(\sum ^{}_{}x^2)-\sum ^{}_{}x\sum ^{}_{}xy}{n(\sum ^{}_{}x^2)-(\sum ^{}_{}x)^2}[/tex]
Thus, we have:
[tex]\begin{gathered} b=\frac{(98.91)(55)-15\ast293.8}{5(55)-(15)^2} \\ \\ \text{ b=}20.671 \end{gathered}[/tex]
Substitute -0.297 for m and 20.671 for b in the slope-intercept form:
y = mx + b
Therefore, the equation of the linear regression for this data is:
y = -0.297x + 20.671
ANSWER:
C. y = -0.297x + 20.671