Linear Regression & Correlation (r, r²)

Fit paired data by ordinary least squares; inspect scatter points, residuals, SSE, r² and predicted Y.

Linear Regression Calculator · Client runtimeSandboxed
Formatted results will render here in real time.

About this linear regression & correlation (r, r²)

Fit paired data by ordinary least squares; inspect scatter points, residuals, SSE, r² and predicted Y Computes exact algebraic and numerical metrics directly in your browser using IEEE 754 precision without round-trip latency.

Formula & calculation mechanics

The execution engine processes input tokens and applies transformations in the browser sandbox. Specifically, Ordinary least squares with an intercept: a=Σ(x−x̄)(y−ȳ)/Σ(x−x̄)², b=ȳ−ax̄; SSE=Σ(y−ŷ)². Pearson r measures linear association, not causation; r² is undefined when all Y values are equal. Prediction evaluates the fitted line, not a confidence interval or a guaranteed future outcome.

Worked numerical calculation

Scenario: What should the example produce?

Sample input:

1,2 2,4 3,5; X=4

Processing: Enter paired observations and fit the line. Inspect coefficients, SSE and points in the scatter plot. Enter an unknown X to estimate Y; outside-range predictions are labelled extrapolation.

Illustrative output:

For (1,2), (2,4), (3,5): a=1.5, b≈0.6666666667, r²=27/28≈0.9642857143, SSE=1/6≈0.1666666667. At X=4, predicted Y=20/3≈6.6666666667 (extrapolation).

Domain range & precision boundaries

2–5000 pairs, at most 500000 UTF-16 code units. Decimal point and optional e notation; no thousands separators. Centred/scaled binary64 computation with compensated sums; rounding and underflow remain possible. Nonfinite inputs or intermediate/output overflow are rejected. Predictions accept any finite X within these computational limits. Printed coefficients may lose cancellation accuracy: predictions use the centred fit. No file or usage quota. Native local calculation, no added calculation dependency, fee or external service. Works offline after loading. All points are plotted without sampling. Hover, click or focus a point; use arrow keys, Home/End, Enter/Space or the selector to inspect its X, Y, fitted Y and signed residual. Overlapping points remain separately selectable. Residuals help inspect unusual points; no automatic outlier classification is asserted.

Calculations in Linear Regression & Correlation (r, r²) use standard IEEE 754 precision or exact rational models. Verify significant accounting or tax figures with authoritative references.

In-browser calculation boundary

Formula calculations and numeric evaluations in Linear Regression & Correlation (r, r²) run synchronously in the browser JavaScript engine with zero server telemetry.

Mathematical formulas & precision standards

Mathematical constants, IEEE 754 floating-point standards, and numerical analysis specifications:

Linear Regression & Correlation (r, r²) verification · Audit standards

How to use it

  1. Enter, paste, or select your input data into the Linear Regression & Correlation (r, r²) workspace controls.
  2. Review parameter fields, units, or options configured for Linear Regression & Correlation (r, r²).
  3. Click the action button or observe immediate live calculations rendered by Linear Regression & Correlation (r, r²).

Frequently asked questions

What is calculated?+

Ordinary least squares with an intercept: a=Σ(x−x̄)(y−ȳ)/Σ(x−x̄)², b=ȳ−ax̄; SSE=Σ(y−ŷ)².

How can I inspect unusual points?+

Boundary constraints concerning "How can I inspect unusual points?" prevent invalid parameter state mutations client-side.

What precision and limits apply?+

No file or usage quota.

What should the example produce?+

Security isolation for "What should the example produce?" ensures zero transmission beyond your local workstation.