Linear Regression Calculator

Analyze the relationship between two variables. Calculate correlation ($r$) and find your line of best fit.

Enter X, Y pairs (one per line)
Statistical Analysis
0.000 Correlation (r)
0.000 R-Squared (r²)
0 Data Points
y = 1.000x + 0.000

Correlation vs. Regression

While closely related, these two statistical methods tell us different things about our data.

  • Correlation Coefficient (r): This measures the strength and direction of a linear relationship. It ranges from -1 to 1. An $r$ of 1 is a perfect positive relationship, -1 is perfect negative, and 0 means no relationship at all.
  • R-Squared ($r^2$): Known as the coefficient of determination, this tells you what percentage of the change in $y$ can be explained by $x$. If $r^2$ is 0.85, it means 85% of the variation is explained by the model.
  • Regression Line ($y = mx + b$): This is the "Line of Best Fit." It minimizes the distance between itself and all data points. $m$ is the slope (how much $y$ changes for every 1 unit of $x$) and $b$ is the y-intercept.