🎓 Statistics & Data • Correlation & Regression
100% Client-Side Privacy
R-Squared Calculator (Coefficient of Determination)
Computes coefficient of determination R² (0 to 100%) indicating goodness-of-fit for regression lines.
Bivariate Linear Modeling Suite
Linear Regression, Correlation & Residuals
Fit ordinary least-squares regression lines, calculate Pearson and Spearman coefficients, examine residuals, and make predictions.
Independent Variable X (Explanatory)7 values
Dependent Variable Y (Response)7 values
Presets:
Ordinary Least Squares Regression Equation
ŷ = 2.225x - 0.4571
Correlation:Very Strong Positive(r = 0.9968)
Pearson r0.9968
R² Explained99.37%
Slope (m)2.225
Sample Covariance10.3833
Fitted Scatter Plot & Residual Errors
Observed Data Point (x_i, y_i) Regression Line ŷ = mx + b Residual (y - ŷ) Predicted Point (x_p, ŷ_p)
Interactive Linear PredictorEvaluate ŷ = 2.225 · (x) - 0.4571
⟹ŷ = 17.3429
Model Diagnostics & Sum of Squares Table
Spearman Rank (r_s)1
Residual Std Error (s_e)0.4194
Slope t-Statistic28.07 (df = 5)
Sum of Squared Errors (SSE)0.8796
Regression SS (SSR)138.6175
Total SS (SST)139.4971
Step-by-Step Mathematical Derivations
1. Dataset Summary Totals:
- N = 7, Mean X (x̄) = 4, Mean Y (ȳ) = 8.4429
- ΣX = 28, ΣY = 59.1, ΣX² = 140, ΣY² = 638.47, ΣXY = 298.7
2. Sum of Squares:
- SS_xx = ΣX² - (ΣX)² / N = 140 - (28)² / 7 = 28
- SS_yy = ΣY² - (ΣY)² / N = 638.47 - (59.1)² / 7 = 139.4971
- SS_xy = ΣXY - (ΣX · ΣY) / N = 298.7 - (28 · 59.1) / 7 = 62.3
3. Slope & Intercept Calculation:
- Slope m = SS_xy / SS_xx = 62.3 / 28 = 2.225
- Intercept b = ȳ - m · x̄ = 8.4429 - (2.225 · 4) = -0.4571
4. Pearson Correlation & R²:
- r = SS_xy / √(SS_xx · SS_yy) = 62.3 / √(28 · 139.4971) = 0.9968
- R² = r² = (0.9968)² = 0.9937 (99.37% of variance explained)
What is R-Squared?
R-squared (coefficient of determination) represents the proportion of variance in the dependent variable that is predictable from the independent variable.
Formula & Step-by-Step Calculation
R² = 1 - (SS_res / SS_tot) = r²
Square of Pearson correlation coefficient in simple linear regression.
Worked Step-by-Step Examples
Example 1
Regression model with Pearson r = 0.85
Solution: R² = 0.7225 (72.25% variance explained)
• (0.85)² = 0.7225 = 72.25%
Common Real-World & Academic Use Cases
- ✓ Validating scientific regression models
- ✓ Financial beta asset volatility fitting
- ✓ Machine learning predictive accuracy scoring
How to Use the R-Squared Calculator (Coefficient of Determination)
1
Enter Data
Input X and Y arrays.
2
Inspect R²
Review percentage of variance explained.
Frequently Asked Questions
Q: What is a good R-squared value?
In laboratory sciences, R² > 0.90 is often desired; in social sciences and consumer behavior, R² around 0.50 can still be meaningful.