Simple linear regression models a response variable as a straight-line function of one explanatory variable. Paste paired numeric columns into the calculator to obtain the exact ordinary least-squares fit, uncertainty bands, residuals, and the standard test for a nonzero slope.
What the Calculator Computes
For observations \((x_i,y_i)\), the fitted line is
\[\hat y=b_0+b_1x,\qquad b_1=\frac{\sum_i(x_i-\bar x)(y_i-\bar y)}{\sum_i(x_i-\bar x)^2},\qquad b_0=\bar y-b_1\bar x.\]
These formulas give the minimizer of the residual sum of squares directly; the calculator does not approximate the coefficients iteratively. It reports the signed Pearson correlation \(r\), the coefficient of determination \(R^2\), the residual standard error, and equivalent \(t\)- and \(F\)-statistics for the slope.
Confidence and Prediction Bands
The inner band estimates the mean response at each explanatory value. The wider prediction band includes both uncertainty in the fitted mean and the residual variation of a future observation. Both use the selected confidence level and a Student \(t\) critical value with \(n-2\) degrees of freedom.
A residual plot helps reveal curvature, changing spread, and isolated observations that a single goodness-of-fit number can conceal. Statistical inference assumes independent errors with constant variance and an appropriate linear mean function; a narrow interval cannot repair a misspecified model.
The geometry of least squares, the normal equations, and the relation between the direct solution and gradient descent provide the mathematical basis for these results.