Breaking down R²
- Input
- SSR=7,5, SST=570
- Expected output
- R²=0,986842
1 − 7.5÷570: the line absorbs 98.68% of the score's total variance, leaving only 1.32% as residual.
r-squared and regression model quality
R² measures the fraction of Y's variance the regression line explains, a number between 0 and 1 (or 0% and 100%). But a high R² does not confirm the relationship is actually linear: a perfect curve, fitted with a straight line, can still produce a high R², hiding the data's real shape.
1 − 7.5÷570: the line absorbs 98.68% of the score's total variance, leaving only 1.32% as residual.
Over 96% of variance "explained" by a line fitted to data that actually follow a parabola: a high R² is not proof of linearity.
The symmetric U pattern in the residuals gives away the curve hidden behind the high R², visible only by plotting the residual against X.
Simple linear regression is a statistical model that describes the relationship between an independent variable X and a dependent variable Y as a line, Ŷ = β₀ + β₁X. The slope β₁ tells you how much Y changes for each one-unit increase in X, and the intercept β₀ is the predicted value of Y when X is zero. It is the foundation of much of data analysis, used both to understand a relationship and to predict values.
Not necessarily: fitting a line to the points (1,1) through (5,25), which follow Y=X², gives R²=0.962567, over 96%, even though the real relationship is a parabola. R² measures closeness to the points, not whether the chosen shape (a line) is the right one.
By plotting the residuals (actual Y minus predicted Y) against X: in the Y=X² example, they form a symmetric U, 2, −1, −2, −1, 2, positive at the ends and negative in the middle, a pattern R² alone does not reveal.
SST is Y's total variance with no model at all, and SSR is what remains after fitting the line; R² = 1 − SSR÷SST measures how much of that variance the line absorbed. In the hours-and-score example, SST=570 and SSR=7.5 give R²=0.986842.
One x, y pair per line. Maximum 200 pairs.
All data stays in your browser. No data is sent to any server.