How do you plot linear regression line?

Answer:
Linear regression looks at the relationship between two variables, X and Y.
The regression line is the "best" line though some data you that you or someone else has collected.
You want to find the best slope and the best y intercept to be able to plot the line that will allow you to predict Y given a value of X.
This is usually done by minimizing the sum of the squares.
Regression Equation is y = a + bx
Slope(b) = (NΣXY - (ΣX)(ΣY)) / (NΣX2 - (ΣX)2)
Intercept(a) = (ΣY - b(ΣX)) / N

In the equation above:
X and Y are the variables given as an ordered pair (X,Y)
b = The slope of the regression line
a = The intercept point of the regression line and the y axis.
N = Number of values or elements
X = First Score
Y = Second Score
ΣXY = Sum of the product of first and Second Scores
ΣX = Sum of First Scores
ΣY = Sum of Second Scores
ΣX2 = Sum of square First Scores
Once you find the slope and the intercept, you plot it the same way you plot any other line!
First answer by Mathdoc. Last edit by Mathdoc. Contributor trust: 424 [recommend contributor recommended]. Question popularity: 3 [recommend question].