Linear Regression screenshot

Linear Regression

Least-squares slope and intercept, R squared, the slope's standard error and a two-tailed p.

Privacy First
0 Runs
Updated 2026-11-06
No upload
Runs in this tab
No signup

What this page computes

Type the x and y values as two comma-separated lists of equal length. The slope is Σ(x − x̄)(y − ŷ)/Σ(x − x̄)² and the intercept is ŷ − b·x̄; the page prints the fitted equation, R², the residual standard error, SE(b) and the t test of b = 0 on n − 2 degrees of freedom with a two-tailed p. Figures print to six significant figures.

A straight line is a model, not a finding: the page does not check linearity, does not report the intercept's standard error and does not predict outside the observed x range. A constant x column is refused because the slope divides by zero, and a constant y column is refused because R² would be undefined.

The lists stay in the tab, and the same pairs always print the same line and p.

The page fits y = a + bx by least squares and prints the slope, the intercept, R², the residual standard error and the two-tailed test for a zero slope. Five pairs give y = 2.2 + 0.6x with R² = 0.6, a slope standard error of 0.282843, t = 2.12132 on 3 degrees of freedom and p = 0.124027. At least three points are required, because n − 2 degrees of freedom would otherwise leave nothing for the test.

Fit a straight line to paired values and test the slope. Two comma-separated lists in; the line, R² and a two-tailed p out.

How to use it

Type the x values as a comma-separated list and the y values the same way; unequal lengths are refused with both counts named. The page prints the fitted equation first, then R², the residual standard error and the slope test, so the line and its uncertainty are read together.

The slope test and R²

The slope test is t = b/SE(b) with n − 2 degrees of freedom and a two-tailed p against the hypothesis that the slope is zero; the page also prints the 95% interval on the slope on the pages that carry it. R² is the share of the variation in y the line explains, so 0.6 means 60% explained and 40% left in the residuals — not a 60% chance that the model is right. A regression with a significant slope is still only a straight line, and the residual plot page is where a curve shows itself.

What to Expect

Best for

  • A straight-line fit with its slope test in one pass

What this tool keeps

  • Nothing leaves this tab: the arithmetic runs in the page you are reading, and a reload discards both the input and the result.

Sample output

y = 2.2 + 0.6x R² = 0.6, n = 5 points, df = 3 SE(slope) = 0.282843, t = 2.12132, p = 0.124027 (two-tailed, H₁: slope ≠ 0) residual standard error s = 0.894427, RSS = 2.4

Frequently asked questions

What does the p-value test?

The hypothesis that the true slope is zero, using t = slope/SE(slope) with n − 2 degrees of freedom and a two-tailed p. It says whether the sample can distinguish the fitted slope from no slope at all.

Why are three points the minimum?

Two points fit a line exactly and leave n − 2 = 0 degrees of freedom, so there is no residual variation to test the slope against. The page refuses fewer than three points by name.

Is my data uploaded?

No. The fit and its test are computed in this page from the two lists you typed, and nothing is posted to a server or stored.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.