Correlation & R-Squared Calculator
Compute Pearson’s correlation coefficient ($r$), determine $R^2$, and visualize linear regression.
Data Entry
Enter paired data. Values can be separated by commas, spaces, or new lines. Number of items in X and Y must match.
Statistics
Scatter Plot
Understanding Correlation and R-Squared
In statistics, Correlation measures the strength and direction of a linear relationship between two variables. The most common measure is Pearson’s r.
Interpreting ‘r’
- Range: $-1 \le r \le 1$.
- Positive ($r > 0$): As X increases, Y tends to increase.
- Negative ($r < 0$): As X increases, Y tends to decrease.
- Zero ($r \approx 0$): No linear relationship.
- Magnitude: Values closer to -1 or 1 indicate a stronger linear relationship.
Coefficient of Determination ($R^2$)
R-squared represents the proportion of the variance for the dependent variable ($Y$) that’s explained by the independent variable ($X$). For example, an $R^2$ of 0.85 means that 85% of the variation in Y is predictable from X. It is a key metric for evaluating the goodness-of-fit of a linear regression model.
Linear Regression
The tool also calculates the Line of Best Fit equation: $y = mx + c$, where $m$ is the slope and $c$ is the y-intercept. This line minimizes the sum of squared vertical distances (residuals) between the data points and the line.