Statistics & probability

Multiple linear regression calculator

Fit a linear regression with one or more predictors from a pasted table: coefficients, standard errors, p-values, R², the F test and a fit plot.

Multiple linear regression calculator
Esc to restore

Your inputs

Your data stays on this device: nothing is uploaded.

One row per observation. Text columns (such as names) are ignored unless chosen. Blank, NA or . marks a missing value. Up to 20,000 rows.

Leave blank to use every other numeric column (up to 50).

Results update as you type. Larger files run when you press Update result.

Your result

Your result will appear here.

More actions

Your inputs stay in this browser. Nothing is uploaded or saved.

A clear answer. Here’s how.

Fits y = b₀ + b₁x₁ + … + bₖxₖ by ordinary least squares, using a Householder QR decomposition of the design matrix rather than the normal equations, which keeps the arithmetic accurate when predictors are on very different scales. A column whose remaining length after the earlier columns is below 1e-7 of its own length (R’s lm tolerance) is reported as collinear, by name, instead of being dropped silently. Rows with a missing value in any chosen column are left out and counted. Standard errors come from s² (XᵀX)⁻¹ with s² = residual sum of squares ÷ (n − p); t = estimate ÷ SE with n − p degrees of freedom gives two-sided p-values and intervals. R² = 1 − RSS ÷ TSS, adjusted R² = 1 − (1 − R²)(n − 1) ÷ (n − p), and F = (explained SS ÷ (p − 1)) ÷ s² tests all slopes at once. Without an intercept, TSS is measured from zero, as R does, so R² is not comparable with a model that has one. With one predictor the figure shows the data, the fitted line and the confidence band for the mean response; with several it plots observed against fitted values. Categorical predictors must be coded as 0/1 columns first. It does not fit interactions, transformations, weights or robust standard errors, and does not check assumptions for you. It is a calculator, not a substitute for a statistician when decisions depend on the answer.

How this is checked

5 reference checks passed These 5 cases were run when this page was built, on 20 October 2026, and all reproduce within the stated tolerance. The same cases are part of the automated tests that run on every change to Toolmoz. Engine version 1.

See the checks and where each expected answer comes from
  1. Case 1

    Inputs
    The tool’s default inputs
    Expected, and what Toolmoz gave
    Coefficient for Intercept expected 37.2272701164472, Toolmoz 37.22727011644719Coefficient for wt expected -3.8778307424046807, Toolmoz -3.8778307424046803Coefficient for hp expected -0.031772946982161, Toolmoz -0.03177294698216099R-squared expected 0.8267854518827914, Toolmoz 0.8267854518827913Residual standard error expected 2.5934117772265655, Toolmoz 2.593411777226567F statistic expected 69.21121339177773, Toolmoz 69.21121339177768Standard error for wt expected 0.6327334943773947, Toolmoz 0.6327334943773951
    Where the expected answer comes from
    R’s lm(mpg ~ wt + hp, data = mtcars) reports 37.22727, −3.87783 (SE 0.63273) and −0.03177, R² 0.8268, residual SE 2.593 on 29 df and F 69.21 on 2 and 29 df; full precision from the normal equations solved in exact fractions by an independent Python script
    Allowed difference
    ±1e-9 relative
  2. Case 2

    Inputs
    Data table, column names in the first line speed,dist 4,2 4,10 7,4 7,22 8,16 9,10 10,18 10,26 10,34 11,17 11,28 12,14 12,20 12,24 12,28 13,26 13,34 13,34 13,46 14,26 14,36 14,60 14,80 15,20 15,26 15,54 16,32 16,40 17,32 17,40 17,50 18,42 18,56 18,76 18,84 19,36 19,46 19,68 20,32 20,48 20,52 20,56 20,64 22,66 23,54 24,70 24,92 24,93 24,120 25,85Response (outcome) column distPredictor columns, separated by commas speed
    Expected, and what Toolmoz gave
    Coefficient for Intercept expected -17.579094890510948, Toolmoz -17.57909489051094Coefficient for speed expected 3.9324087591240877, Toolmoz 3.9324087591240877Standard error for speed expected 0.4155127766571223, Toolmoz 0.4155127766571226R-squared expected 0.6510793807582509, Toolmoz 0.6510793807582509Residual standard error expected 15.379586748819907, Toolmoz 15.379586748819909F statistic expected 89.56710653646773, Toolmoz 89.56710653646773
    Where the expected answer comes from
    R’s lm(dist ~ speed, data = cars) reports −17.5791 and 3.9324 (SE 0.4155), R² 0.6511, residual SE 15.38 on 48 df and F 89.57; full precision from exact fractions in an independent Python script
    Allowed difference
    ±1e-9 relative
  3. Case 3

    Inputs
    Data table, column names in the first line speed,dist 4,2 4,10 7,4 7,22 8,16 9,10 10,18 10,26 10,34 11,17 11,28 12,14 12,20 12,24 12,28 13,26 13,34 13,34 13,46 14,26 14,36 14,60 14,80 15,20 15,26 15,54 16,32 16,40 17,32 17,40 17,50 18,42 18,56 18,76 18,84 19,36 19,46 19,68 20,32 20,48 20,52 20,56 20,64 22,66 23,54 24,70 24,92 24,93 24,120 25,85Response (outcome) column distPredictor columns, separated by commas speedIntercept no
    Expected, and what Toolmoz gave
    Coefficient for speed expected 2.909132143937103, Toolmoz 2.909132143937103R-squared expected 0.8962893058052056, Toolmoz 0.8962893058052057F statistic expected 423.4681517218068, Toolmoz 423.468151721807
    Where the expected answer comes from
    Through the origin: b = Σxy ÷ Σx² = 2.90913 and R² measured from zero (Σy² as total), from exact fractions in an independent Python script
    Allowed difference
    ±1e-9 relative
  4. Case 4

    Inputs
    Predictor columns, separated by commas
    Expected, and what Toolmoz gave
    Coefficients expected 7, Toolmoz 7R-squared expected 0.8548224115848233, Toolmoz 0.8548224115848232Adjusted R-squared expected 0.8199797903651809, Toolmoz 0.8199797903651808Coefficient for wt expected -4.19083237723127, Toolmoz -4.190832377231272Residual standard error expected 2.557161043993454, Toolmoz 2.557161043993455F statistic expected 24.533814668998556, Toolmoz 24.533814668998538
    Where the expected answer comes from
    All six numeric predictors (cyl, disp, hp, drat, wt, qsec; the model names are text and are skipped): normal equations in exact fractions in an independent Python script
    Allowed difference
    ±1e-9 relative
  5. Case 5

    Inputs
    Predictor columns, separated by commas wt
    Expected, and what Toolmoz gave
    Coefficient for Intercept expected 37.285126167342035, Toolmoz 37.28512616734202Coefficient for wt expected -5.344471572722677, Toolmoz -5.344471572722676R-squared expected 0.7528327936582646, Toolmoz 0.7528327936582645
    Where the expected answer comes from
    R’s lm(mpg ~ wt, data = mtcars) reports 37.2851 and −5.3445 with R² 0.7528; full precision from exact fractions in an independent Python script
    Allowed difference
    ±1e-9 relative

What this shows: the engine reproduces independently worked values for these cases. It does not prove every possible input is right. To test an answer you were given, see how to check a number; to see what is and is not checked across Toolmoz, see the accuracy ledger.

See a worked example

Worked example

A fixed demonstration, separate from the values you enter above.

Data table, column names in the first line
model,mpg,cyl,disp,hp,drat,wt,qsec
Mazda RX4,21.0,6,160.0,110,3.90,2.620,16.46
Mazda RX4 Wag,21.0,6,160.0,110,3.90,2.875,17.02
Datsun 710,22.8,4,108.0,93,3.85,2.320,18.61
Hornet 4 Drive,21.4,6,258.0,110,3.08,3.215,19.44
Hornet Sportabout,18.7,8,360.0,175,3.15,3.440,17.02
Valiant,18.1,6,225.0,105,2.76,3.460,20.22
Duster 360,14.3,8,360.0,245,3.21,3.570,15.84
Merc 240D,24.4,4,146.7,62,3.69,3.190,20.00
Merc 230,22.8,4,140.8,95,3.92,3.150,22.90
Merc 280,19.2,6,167.6,123,3.92,3.440,18.30
Merc 280C,17.8,6,167.6,123,3.92,3.440,18.90
Merc 450SE,16.4,8,275.8,180,3.07,4.070,17.40
Merc 450SL,17.3,8,275.8,180,3.07,3.730,17.60
Merc 450SLC,15.2,8,275.8,180,3.07,3.780,18.00
Cadillac Fleetwood,10.4,8,472.0,205,2.93,5.250,17.98
Lincoln Continental,10.4,8,460.0,215,3.00,5.424,17.82
Chrysler Imperial,14.7,8,440.0,230,3.23,5.345,17.42
Fiat 128,32.4,4,78.7,66,4.08,2.200,19.47
Honda Civic,30.4,4,75.7,52,4.93,1.615,18.52
Toyota Corolla,33.9,4,71.1,65,4.22,1.835,19.90
Toyota Corona,21.5,4,120.1,97,3.70,2.465,20.01
Dodge Challenger,15.5,8,318.0,150,2.76,3.520,16.87
AMC Javelin,15.2,8,304.0,150,3.15,3.435,17.30
Camaro Z28,13.3,8,350.0,245,3.73,3.840,15.41
Pontiac Firebird,19.2,8,400.0,175,3.08,3.845,17.05
Fiat X1-9,27.3,4,79.0,66,4.08,1.935,18.90
Porsche 914-2,26.0,4,120.3,91,4.43,2.140,16.70
Lotus Europa,30.4,4,95.1,113,3.77,1.513,16.90
Ford Pantera L,15.8,8,351.0,264,4.22,3.170,14.50
Ferrari Dino,19.7,6,145.0,175,3.62,2.770,15.50
Maserati Bora,15.0,8,301.0,335,3.54,3.570,14.60
Volvo 142E,21.4,4,121.0,109,4.11,2.780,18.60
Column separator
Detect automatically
Response (outcome) column
mpg
Predictor columns, separated by commas
wt, hp
Intercept
Include an intercept
Confidence level
95%

Example result

Example result
TermEstimateStd errort valueP-value95% CI lower95% CI upper
Intercept37.227271.59878823.284692.57e-20 (below 0.0001)33.9573840.49716
wt-3.8778310.6327335-6.1286951.12e-6 (below 0.0001)-5.171916-2.583745
hp-0.031772950.00902971-3.5187120.001451-0.05024078-0.01330512

mpg = 37.227 − 3.8778 × wt − 0.031773 × hp. Residuals: minimum -3.941, quartiles -1.6, -0.182, 1.05, maximum 5.854. Ordinary least squares by Householder QR. Coefficient intervals use t with 29 df. Check the residuals for curvature, unequal spread and influential points before trusting the p-values.