Regression Explorer

Fit a line, move the slope and intercept, and watch residuals and error statistics update live

lm() resid() fitted()
Controls
Show residuals
Lock to centroid
This toggle forces the line through the point (x, ȳ), the intersection of the mean study hours and mean exam score. All lines that pass through this point have zero average prediction error (i.e., the sum of the residuals will always be zero). The OLS line always passes through this point, which is why the sum of the raw (unsquared) residuals is zero.
Reference lines
Select both the Mean Line and OLS Line to see how is calculated. This value tells us how much of the variation in exam scores is described by study time (i.e, rather than being random error).
Scatterplot
SSerror
MSE
RMSE
R Code