A non-perfect fit
Pairs (1,2), (2,3), (3,5) give slope 1.5, intercept 0.333333, R² 0.964286 and residual standard error 0.408248. At x=4, predicted y is 6.333333 and the tool labels extrapolation.
Fit a least-squares line to paired observations with residuals, correlation, parameter standard errors and labelled prediction uncertainty.
Enter your inputs and calculate to see the result.
Runs in your browser — nothing you enter is sent to a server.
Fit an unweighted straight line with an intercept using centered, compensated sums. Inspect every fitted value and residual, R² and Pearson correlation. For an optional x, report predicted y, standard error of the mean response s√(1/n+(x−x̄)²/Sxx), and standard error of a new observation s√(1+1/n+(x−x̄)²/Sxx).
Fit a least-squares line to paired observations with residuals, correlation, parameter standard errors and labelled prediction uncertainty.
b = Σ(x−x̄)(y−ȳ)/Σ(x−x̄)²; a = ȳ−bx̄; ŷ = a+bx. s² = Σ(y−ŷ)²/(n−2). SE(b)=s/√Sxx; SE(a)=s√(1/n+x̄²/Sxx).
Inputs must be finite numbers within ±1 billion; nonzero observations smaller than 1e-100 must be rescaled. x must vary. Two pairs define a line but cannot estimate residual uncertainty. Constant y makes correlation and R² undefined. Standard errors assume independent, constant-variance errors and a suitable straight-line model; they are not confidence intervals. No causal claim, weighted fit, missing-value imputation or automatic outlier deletion. Predictions outside the observed x range are labelled extrapolation. Display uses six decimals; very small nonzero results use scientific notation.
Pairs (1,2), (2,3), (3,5) give slope 1.5, intercept 0.333333, R² 0.964286 and residual standard error 0.408248. At x=4, predicted y is 6.333333 and the tool labels extrapolation.
(1,2) and (2,4) give slope 2 and intercept 0. The line is defined, but residual degrees of freedom are zero, so parameter and prediction standard errors are undefined.
Fit an unweighted straight line with an intercept using centered, compensated sums. Inspect every fitted value and residual, R² and Pearson correlation. For an optional x, report predicted y, standard error of the mean response s√(1/n+(x−x̄)²/Sxx), and standard error of a new observation s√(1+1/n+(x−x̄)²/Sxx).
Inputs must be finite numbers within ±1 billion; nonzero observations smaller than 1e-100 must be rescaled. x must vary. Two pairs define a line but cannot estimate residual uncertainty. Constant y makes correlation and R² undefined. Standard errors assume independent, constant-variance errors and a suitable straight-line model; they are not confidence intervals. No causal claim, weighted fit, missing-value imputation or automatic outlier deletion. Predictions outside the observed x range are labelled extrapolation. Display uses six decimals; very small nonzero results use scientific notation.
Pairs (1,2), (2,3), (3,5) give slope 1.5, intercept 0.333333, R² 0.964286 and residual standard error 0.408248. At x=4, predicted y is 6.333333 and the tool labels extrapolation. Compare this worked case before using your own inputs.
Good to know
Inputs must be finite numbers within ±1 billion; nonzero observations smaller than 1e-100 must be rescaled. x must vary. Two pairs define a line but cannot estimate residual uncertainty. Constant y makes correlation and R² undefined. Standard errors assume independent, constant-variance errors and a suitable straight-line model; they are not confidence intervals. No causal claim, weighted fit, missing-value imputation or automatic outlier deletion. Predictions outside the observed x range are labelled extrapolation. Display uses six decimals; very small nonzero results use scientific notation.
Prediction standard errors: Penn State STAT 501, estimation and prediction. Reference: NIST: least-squares estimates and residual standard deviation. The implementation scope and conventions above are authoritative for this worksheet.
Calculate the standard deviation, variance and mean of a data set, for a sample or a population.
Math Tools
Compare quartile conventions, calculate IQR and outlier fences, and draw a responsive box plot with observed-value whiskers and numeric results.
Calculators