Linear Regression Calculator
Find the least-squares line y = mx + b, the correlation r, and R². Enter one x,y pair per line.
① Answer
Slope (m)
Intercept (b)
Correlation (r)
R²
② Steps
③ Why it works
The least-squares line minimizes the total squared vertical distance from every point to the line — squaring punishes big misses more than small ones, so the line settles where the overall error is smallest. The correlation r (−1 to +1) measures how tightly the points hug any straight line, and R² tells you what fraction of the y-variation the line explains.
④ Visualization
Data pointLeast-squares line