Handy Orchard

Linear regression worksheet

Fit a line to paired data and inspect fitted values, correlation, residuals and a labelled estimate.

Your input

One row: x | y. Enter 2–2,000 finite pairs.

Leave blank to omit. Beyond the observed x range is labelled extrapolation.

Outputs are cleared when the input changes.

Result

Enter your data or use the example, then run the tool.

Worked example

(1,3), (2,5), (3,7) fit y = 1 + 2x, with R² = 1 and zero residuals.

x = 4 gives an estimated y = 9, labelled extrapolation outside the observed range 1–3.

Method

Ordinary least squares with an intercept uses slope Sxy/Sxx and intercept mean(y) − slope × mean(x). Centered calculation reduces cancellation.

Each residual is observed y minus fitted y. The two charts show observations with the fitted line and residuals against x.

Limits

All x equal is rejected. Constant y makes correlation and R² undefined. Extreme scales or insufficient floating-point variation may be rejected.

No causal conclusions, automatic confidence intervals, professional forecasts or outlier removal. Extrapolation is only a model estimate.

Sources

NIST: least-squares estimation

Related tools

Dataset distribution summaryK-means data clusteringUncertainty propagation worksheetBinomial probability calculator

Your inputs stay on this device. Only optional, consented page visits are measured. Input values, files, filenames and processing logs are not sent to Analytics.

When switching languages, text, settings and selected files are temporarily kept on this device. Transfers are removed after restoring; interrupted transfers are cleaned up on a later visit. Inputs and files are never uploaded.