Simple Linear Regression

We will use the Linear Regression technique to generate trend lines for a randomly generated vector. To do this, we will search for a line whose distance from each of the data points in the vector is minimal. This distance will be calculated using the sum of squares of two data points. So the formula that we are using to determine this line is

D = i = 1 to n [yi - (0 + 1x)]2

For simple linear regression, we can find the line that minimizes this line by the following equations:

SXY = i = 1 to n(xy) -
(i = 1 to nx)(i = 1 to ny)

n
SXX = i = 1 to n(x2) -
(i = 1 to nx)2

n
1 =
SXY

SXX
0 = - 1

Show Work
your browser does not support the canvas tag