Statistics & Probability

Simple Linear Regression & Prediction Calculator

Fit an ordinary least-squares straight line to paired observations and predict at one selected x value.

How the calculation works

Fitted slope = covariance(x,y)/sample_variance(x) Y per X. Fitted intercept = mean(y)-covariance(x,y)/sample_variance(x)*mean(x) Y units. Pearson correlation = correlation(x,y) r. Residual standard error = regression_se(x,y) Y units. Fitted mean prediction = mean(y)+covariance(x,y)/sample_variance(x)*(predict_x-mean(x)) Y units.

Worked example

Example inputs — X observations: 1, 2, 3, 4; Matching Y observations: 3, 5, 7, 9; X value for fitted mean prediction: 5. Expected results — Fitted slope: 2 Y per X; Fitted intercept: 1 Y units; Pearson correlation: 1 r; Residual standard error: 0 Y units; Fitted mean prediction: 11 Y units.

Assumptions and limits

Statistical model only: input assumptions and data quality determine whether a result is meaningful. No observational dataset is uploaded. Use dots for decimals and no thousands separators in lists. At least three matched observations and nonconstant X/Y. Fits an intercept and does not establish causation. Prediction intervals, outlier diagnostics and extrapolation validity are not provided.

Reference and further reading

Read the underlying subject reference. Calculith is an independent implementation; the reference does not endorse or certify this tool.

Related calculators

Browse all 1000 calculators →

Example values are editable. Results are estimates where assumptions apply. Calculations run in your browser. Updated 2026-11-16.