Linear regression in simple words
Linear regression draws the straight line that fits a set of points best. You can then use the line to guess new values.
The line is written y = intercept + slope × x. The slope is how much y goes up when x goes up by 1. The intercept is where the line crosses the y-axis, when x is 0.
For example, with the points (1, 2), (2, 4), (3, 5) and (4, 8), the best line is y = 0 + 1.9x. So at x = 5 the line predicts y = 1.9 × 5 = 9.5.
R² tells you how close the points are to the line. 1 means they all sit exactly on it; close to 0 means the line does not describe them well.
Formula and method
Slope = Σ(x − x̄)(y − ȳ)/Σ(x − x̄)². Intercept = ȳ − slope × x̄. The prediction is intercept + slope × x.
Worked example
For x values 1, 2, 3 and y values 3, 5, 7, the fitted line is y = 1 + 2x with R² = 1.