Compute R-squared (R²), Pearson correlation coefficient (r), slope, intercept, and regression line equation from your (x, y) data.Visualize the scatter plot and best‑fit line instantly. Essential for goodness-of-fit analysis, predictive modeling, and statistical learning.
R² measures the proportion of variance in the dependent variable (Y) that is predictable from the independent variable (X) using a linear regression model. It ranges from 0 to 1—closer to 1 indicates that the model explains a large fraction of the data's variability. In simple linear regression, R² equals the square of the Pearson correlation coefficient (r).
The ordinary least squares (OLS) method minimizes the sum of squared residuals. Slope (b) = Cov(X,Y)/Var(X), intercept a = ȳ - b·x̄. The tool validates numeric inputs, checks for sufficient variation (non‑constant X), and prevents division by zero. Linear regression assumes linearity, independence, homoscedasticity, and normality of residuals for inference — yet R² remains a descriptive metric even when assumptions are mildly violated.
| R² Value | Interpretation | Example Context |
|---|---|---|
| > 0.80 | Very strong linear relationship | Height vs. shoe size (population average) |
| 0.50 – 0.79 | Moderate predictive power | Study hours vs. exam scores |
| 0.20 – 0.49 | Weak linear association | Daily temperature vs. stock returns |
| < 0.20 | Little to no linear fit | Randomized controlled noise |
A digital agency tracks monthly ad spend (X, in $1000) and revenue (Y, in $1000) for 8 months. Using our calculator they obtain R² = 0.87, meaning 87% of revenue variation is explained by ad spend. Slope = 3.2 indicates each $1K ad spend yields $3.2K additional revenue. The scatter plot reveals linear trend and few outliers, confirming reliable forecasting.