BY: Statistics Fundamentals Team
Reviewed By: Minsa A (Senior Statistics Editor)
Updated:

Multiple Linear Regression Calculator

Paste a table of data, choose the dependent variable, and this calculator fits an ordinary least squares model with up to 15 predictor terms. It returns each coefficient with its standard error, t-statistic, p-value and confidence interval, plus R², adjusted R², the overall F-test, VIF, residual plots and the matrix algebra behind the fit. All of it runs in your browser and your data is never uploaded.

Multiple regression calculator

Model Y = b₀ + b₁X₁ + b₂X₂ + … + bₖXₖ + e Method ordinary least squares
One row per observation. Separate columns with commas, tabs, semicolons or spaces. The first column is treated as Y unless you change it below.

Fit a model on the first tab, then return here to enter new predictor values and get a predicted Y with a confidence interval for the mean and a prediction interval for a single new observation.

Fit a model on the first tab to see the matrices XᵀX, Xᵀy and (XᵀX)⁻¹ for your data, followed by every sum of squares and test statistic written out with your numbers.

Fit a model on the first tab to see the residuals-versus-fitted plot, the observed-versus-predicted plot and a table of residuals, leverage and Cook's distance for each row.

What is a multiple linear regression calculator?

A multiple linear regression calculator fits a linear equation with two or more predictors to your data and reports how well that equation explains the outcome. It finds the intercept and slopes that minimise the sum of squared residuals, then tests each slope against zero.

The model is Y = b₀ + b₁X₁ + … + bₖXₖ. Each slope tells you how much Y changes for a one-unit change in that predictor while the other predictors stay fixed. That "stay fixed" clause is the whole reason to use several predictors at once: it separates effects that overlap in the raw data.

Many online tools only evaluate an equation you already have, which is useful for one prediction but does not estimate anything. This one starts from raw data. If you already hold the coefficients and only want a prediction, the multiple linear regression guide has a small prediction widget for that. With one predictor, use the simple linear regression calculator.

How to use this calculator

Paste your data, check which column is Y, and press Calculate. The steps below take about two minutes.

1
Paste or upload your data

Copy a block of cells from Excel or Google Sheets, or press Upload CSV. Put the names in the first row and one observation in each row.

2
Check the dependent variable

The first column is chosen as Y. Change it in the Dependent variable menu if your outcome sits in another column.

3
Choose the predictors

All other columns are ticked. Untick any column that should stay out of the model, such as an ID number.

4
Press Calculate

The calculator reads the table, drops incomplete rows, builds dummy variables for text columns and fits the model by least squares.

5
Read the results

Start with R², adjusted R² and the F-test, then the coefficient table and VIF. The Diagnostics tab shows residual plots and per-row influence.

6
Predict or check the steps

Use the Predict tab for a new observation with intervals, and the Matrix steps tab to follow the algebra with your own numbers.

What the calculator does with imperfect data

Table: input situations and how each is handled
SituationWhat happens
Blank, NA, NaN or "." in a used columnThe whole row is dropped (listwise deletion). The results show how many rows were removed.
Text in a predictor columnWith the dummy option on, the column becomes k − 1 dummy variables. The category that sorts first alphabetically is the reference group.
Text in the Y columnError. Y must be numeric.
A predictor with the same value in every rowError naming the column. A constant has no variation to estimate a slope from.
Two predictors that are exact copies or multiplesError naming the correlated pair. This is perfect multicollinearity and the matrix XᵀX cannot be inverted.
Fewer than k + 2 usable rowsError. With n = k + 1 the model fits exactly and leaves zero degrees of freedom for testing.
Fewer than 10 rows per predictorThe fit runs, with a warning that the estimates will be unstable.
A text column with an ID-like number of distinct valuesError instead of dozens of meaningless dummies.

Multiple linear regression formula

The least squares estimate is b = (XᵀX)⁻¹Xᵀy, where X is the n × (k + 1) matrix of predictors with a leading column of ones and y is the vector of outcomes. Every other statistic on this page follows from b and the residuals.

Model and estimator

Y = β₀ + β₁X₁ + … + βₖXₖ + ε y = Xβ + ε b = (XᵀX)⁻¹ Xᵀy ŷ = Xb e = y − ŷ

Sums of squares

SST = Σ(yᵢ − ȳ)² SSE = Σ eᵢ² SSR = SST − SSE df: model = k, error = n − k − 1

Fit statistics

R² = SSR / SST Adj. R² = 1 − (1 − R²)(n − 1)/(n − k − 1) MSE = SSE / (n − k − 1) s = √MSE F = (SSR / k) / MSE

Inference for each coefficient

SE(bⱼ) = √( MSE · [(XᵀX)⁻¹]ⱼⱼ ) t = bⱼ / SE(bⱼ) CI = bⱼ ± t* · SE(bⱼ) t* from the t-distribution, df = n − k − 1

Variance inflation factor

VIFⱼ = 1 / (1 − Rⱼ²) Rⱼ² comes from regressing predictor j on all the other predictors

Leverage and Cook's distance

hᵢ = xᵢᵀ (XᵀX)⁻¹ xᵢ Dᵢ = eᵢ² hᵢ / ( (k+1) · MSE · (1 − hᵢ)² )

The F-test compares the full model with an intercept-only model, so it asks whether at least one slope differs from zero. The t-tests ask the same question one coefficient at a time. Both use the error degrees of freedom n − k − 1 described on the degrees of freedom page, and the F statistic follows the F-distribution. For the one-predictor version of the derivation, see the page on OLS regression.

Worked example: exam scores

The "Example: exam scores" button loads 30 invented students with a final exam score (Y), weekly hours studied, average nightly hours of sleep and number of practice tests taken. The data are made up for illustration, so the results show how to read the output and say nothing about real students.

Table: fitted model, score ~ hours + sleep + tests (n = 30)
TermCoefficientStd. errortp-value95% CIVIF
Intercept38.2189.2914.1130.000319.12 to 57.32n/a
hours2.0230.4524.4790.00011.09 to 2.953.34
sleep0.6761.1420.5910.5593-1.67 to 3.021.22
tests3.2250.8453.8170.00081.49 to 4.963.29

The fitted equation is score = 38.22 + 2.023 × hours + 0.676 × sleep + 3.225 × tests. The model has R² = 0.8858, adjusted R² = 0.8727, F(3, 26) = 67.24 with p < 0.0001, and a residual standard error of 4.66 points.

Reading it from the top: the F-test is significant, so the predictors together explain more than chance would. Holding sleep and practice tests fixed, one more weekly study hour goes with about 2.0 more points. One more practice test goes with about 3.2 points. The sleep coefficient is positive but its interval runs from -1.67 to 3.02, so these 30 rows cannot separate it from zero. That is a statement about the data, and it does not show that sleep is irrelevant to exam performance.

Compare this with a simple regression of score on hours alone, which gives a slope of 3.38. The multiple regression slope is 2.02 because hours and practice tests are correlated (r = 0.83). The one-predictor model credits hours with part of what practice tests contribute. This is the situation multiple regression exists for, and the VIF of 3.3 for hours and tests records how much they overlap.

Prediction check: for a student who studies 10 hours, sleeps 7 hours and takes 4 practice tests, the model predicts 76.07. The 95% confidence interval for the average of all such students is 73.83 to 78.31. The 95% prediction interval for one new student is wider, 66.23 to 85.92, because it adds the student-to-student scatter around the line. The Predict tab reproduces both intervals.

How to read the output

Start with the F-test and adjusted R² to judge the model as a whole, then read the coefficient table, then check VIF and the residual plots before trusting any single p-value.

Table: statistics in the output and what each one tells you
StatisticSymbolWhat it tells youWhat to check
R-squaredR²Share of the variance in Y explained by all predictors togetherNever falls when you add a predictor, even a useless one
Adjusted R-squaredR²adjR² with a penalty for each predictorUse it to compare models with different numbers of predictors
Multiple RR = √R²Correlation between observed and fitted YAlways between 0 and 1
Residual standard errors = √MSETypical size of a prediction error, in the units of YCompare it with the standard deviation of Y
F-statisticF(k, n−k−1)Tests whether all slopes are zero at onceA significant F does not mean every predictor matters
CoefficientbⱼChange in Y for a one-unit change in Xⱼ, other predictors fixedDepends on the units of Xⱼ
Standard errorSE(bⱼ)How much bⱼ would vary across repeated samplesShrinks as n grows, grows with collinearity
t-statistic and p-valuet, pTests H₀: βⱼ = 0 for one coefficientp above 0.05 means the data cannot distinguish bⱼ from zero
Confidence intervalbⱼ ± t*·SERange of slopes consistent with the dataAn interval containing 0 matches p above the chosen alpha
Standardized betaβ*Slope when X and Y are in standard-deviation unitsLets you compare predictors measured on different scales
Variance inflation factorVIFⱼHow much collinearity inflates the variance of bⱼSee the VIF section below
LeveragehᵢHow unusual row i is in the predictor spaceAverage leverage is (k+1)/n
Cook's distanceDᵢHow far the fit moves if row i is removedValues above 4/n deserve a look
Durbin-WatsonDWFirst-order autocorrelation in the residualsNear 2 means little; only meaningful when rows are in time order

Because the p-value of a coefficient depends on the other predictors in the model, a predictor can be significant alone and not significant in the full model. The p-values guide covers the general definition, and statistical interpretation shows how to word a result in a report.

R-squared versus adjusted R-squared

R² measures the share of variance explained and always rises when you add a predictor. Adjusted R² charges a penalty for each predictor, so it rises only when the new variable improves the fit by more than chance would.

The exam data show the difference. Adding sleep to a model with hours and tests raises R² from 0.8843 to 0.8858, yet adjusted R² falls from 0.8757 to 0.8727 and the residual standard error rises from 4.61 to 4.66. The extra variable does not earn its place.

Table: three models fitted to the exam data (n = 30)
ModelPredictorsR²Adjusted R²Residual SE
hours10.82170.81535.616
hours + tests20.88430.87574.607
hours + sleep + tests30.88580.87274.663

There is no universal threshold for a good R². Models of controlled physical processes often reach 0.9 or more, while models of human behaviour are usually far lower and can still be useful. The page on what counts as a good R-squared goes through the field-by-field differences, and the R-squared visualizer shows how scatter changes the number.

Assumptions and where to check them here

The coefficient estimates need only a linear relationship, but the p-values and intervals rely on the error assumptions below. The Diagnostics tab produces the evidence for each.

Table: regression assumptions and the matching check
AssumptionWhere to lookIf it fails
Linearity: the mean of Y is a straight-line function of the predictorsResiduals versus fitted plot. A curve means the form is wrong.Add a squared term as a new column, or transform a variable
Independent errorsDurbin-Watson, if the rows are in time or sequence orderUse time series methods, see time series analysis
Constant error varianceResiduals versus fitted plot. A funnel shape means unequal spread.See heteroscedasticity
Roughly normal errorsStandardized residuals, mostly within ±2 and rarely beyond ±3Matters most for small n. See normality tests
No perfect multicollinearityVIF column, or the singular-matrix errorRemove or combine redundant predictors
No single row driving the fitCook's distance and leverage columnsCheck the row for a data error before dropping it. See influential points

The site's assumptions hub collects the checks for other tests too, and the page on regression residuals explains how to read the plots. To plot residuals for data you hold elsewhere, use the residual plot generator.

Multicollinearity and VIF

Multicollinearity means two or more predictors move together so closely that the model cannot tell their effects apart. It leaves the overall fit alone but inflates the standard errors of the affected coefficients, and the VIF measures by how much.

A VIF of 1 means a predictor is uncorrelated with the others. A VIF of 4 means the variance of its coefficient is four times what it would be with no overlap, so its standard error is doubled. Sources disagree on where to draw the line, which the table below shows.

Table: published VIF cutoffs differ
SourceGuidance
SSCC, University of WisconsinGives cutoffs of 5 or 10 for concern
UVA LibrarySays 10 or higher is commonly used, while others recommend stricter values such as 3 or even 2
O'Brien (2007)Argues that a VIF of 10, 20 or even 40 does not by itself justify dropping a variable
This calculatorMarks VIF above 5 as moderate and above 10 as high. It never removes anything for you.

Treat these numbers as prompts to look, not verdicts. A high VIF on a control variable you do not interpret is usually harmless. A high VIF on the predictor you care about means its coefficient will be imprecise, and the usual fixes are to combine or drop one of the overlapping variables, centre variables before building squared or interaction terms, or collect more data. Excel's regression tools do not report VIF, so this is one place a dedicated calculator saves a manual step.

Categorical predictors and dummy variables

A categorical predictor with m categories enters the model as m − 1 dummy variables (0 or 1). The omitted category is the reference group, and each dummy coefficient is the average difference from that group, holding the other predictors fixed.

Try "Example: salary by department". It has 30 employees with salary in thousands, years of experience and a department label (Engineering, Sales or Support). Engineering sorts first, so it becomes the reference.

Table: salary ~ years + department (n = 30, reference = Engineering)
TermCoefficientStd. errorp-value95% CI
Intercept62.9341.368<0.000160.12 to 65.75
years2.4370.141<0.00012.15 to 2.73
department = Sales-8.3531.459<0.0001-11.35 to -5.35
department = Support-16.1741.480<0.0001-19.22 to -13.13

An engineer with no experience is predicted to earn 62.9 thousand. Each year adds 2.44 thousand. At the same experience, Sales pays about 8.4 thousand less than Engineering and Support about 16.2 thousand less. R² is 0.9325. Including a dummy for every department as well as the intercept would make the dummies sum to the intercept column, which is perfect collinearity and is called the dummy variable trap.

Choosing a different reference group changes the coefficients and their p-values but not the fitted values or R². To pick your own reference, put a character such as "A_" in front of that label so it sorts first. Categories coded as numbers (1, 2, 3) are read as numeric, so replace them with text labels first. The page on types of data explains the distinction.

Multiple versus multivariate regression

Multiple linear regression has one dependent variable and several predictors. Multivariate regression has several dependent variables modelled together. The two names are often swapped, and some tools titled "multivariate regression calculator" actually fit a multiple regression. The Analysis Factor and DataCamp both draw this line. This page handles one Y at a time. To model two outcomes, run it twice, which gives the same coefficients as a joint fit but does not account for correlation between the outcomes' errors.

How many observations and predictors do you need?

The hard minimum is n ≥ k + 2 so that at least one error degree of freedom remains. For stable estimates, guides commonly suggest 10 to 20 observations per predictor, and the calculator warns when you have fewer than 10. That is a rule of thumb, not a guarantee. The sample you need depends on the effect size you want to detect, how noisy Y is, and how correlated the predictors are. With 30 rows, three predictors is about the limit.

To plan a study, use the power analysis calculator and the effect size calculator. The sample size calculator covers general estimation problems. The multiple regression examples page works through more datasets with different predictor counts.

Run the same model in Excel, R or Python

The calculator is handy for a quick check. For a reproducible analysis, the same model takes a few lines in common software, and you can compare the output with the figures above.

Excel
=LINEST(B2:B31, C2:E31, TRUE, TRUE)

LINEST returns coefficients in reverse order: the last predictor first and the intercept last, so with columns hours, sleep, tests the first cell holds the tests coefficient. Enter it as an array formula over a block 4 columns wide and 5 rows tall. Microsoft documents the layout in its LINEST reference. The Data Analysis ToolPak regression tool gives a labelled table instead, but neither tool reports VIF.

R
exam <- read.csv("exam.csv") model <- lm(score ~ hours + sleep + tests, data = exam) summary(model) # coefficients, R-squared, F-test confint(model) # 95% confidence intervals car::vif(model) # variance inflation factors
Python (statsmodels)
import pandas as pd import statsmodels.formula.api as smf exam = pd.read_csv("exam.csv") model = smf.ols("score ~ hours + sleep + tests", data=exam).fit() print(model.summary())

The Python snippet was run on the exam data and returns the same coefficients, R² and F-statistic as the table above. SPSS, Stata and Minitab label the same quantities differently, and UCLA's annotated SPSS output maps each block of the printout to the statistics listed earlier. For a code-first treatment with scikit-learn, see the full guide.

When a different tool fits better

Table: choosing between related calculators
Your situationBetter fit
One predictor and one outcomeSimple linear regression calculator
The outcome is yes/no or 0/1Logistic regression
You only want the strength of a pairwise relationshipCorrelation calculator
You are comparing group means and have no continuous predictorANOVA calculator, and how ANOVA relates to regression
You want to see the shape of one relationship firstRegression scatter plot
You need to scan a CSV for problems before modellingCSV data analyzer and outlier detector

Accuracy, privacy and limits

The calculation runs entirely in your browser, so pasted data and uploaded files are not sent anywhere. The fitting code was checked against NumPy and SciPy on three test datasets, including one with a predictor around the year 2000 to stress numerical stability, and agreed to at least seven significant figures for coefficients, p-values, intervals, leverage and Cook's distance. It has not been compared against R, SPSS or Stata output.

The tool fits ordinary least squares only. It has no weights, no robust standard errors and no automatic interaction or polynomial terms. To add an interaction, create a column in your spreadsheet that multiplies the two predictors, and for a squared term add a column of squares. Regression shows association. It cannot establish that a predictor causes a change in Y, which is the subject of correlation versus causation.

Related topics on Statistics Fundamentals

Start from the calculators hub for every tool on the site, or from the regression guides below.

Sources and further reading

  • Penn State STAT 501, Lesson 5: Multiple linear regression. online.stat.psu.edu
  • Social Science Computing Cooperative, University of Wisconsin. Multicollinearity and VIF in regression diagnostics. sscc.wisc.edu
  • University of Virginia Library. Addressing multicollinearity. library.virginia.edu
  • O'Brien, R.M. (2007). A caution regarding rules of thumb for variance inflation factors. Quality & Quantity. springer.com
  • Microsoft Support. LINEST function. support.microsoft.com
  • UCLA OARC. Regression with SPSS: annotated output for multiple regression analysis. stats.oarc.ucla.edu
  • Scribbr. Multiple linear regression: a quick guide. scribbr.com
  • The Analysis Factor. Multiple versus multivariate regression. theanalysisfactor.com

Frequently asked questions

It is a tool that fits an equation with two or more predictors to your data by ordinary least squares. It reports the intercept and slopes, a t-test and confidence interval for each, R², adjusted R² and an overall F-test.

Paste your data with column names in the first row, confirm which column is Y, tick the predictors and press Calculate. Text columns are turned into dummy variables automatically.

It is the expected change in Y for a one-unit increase in that predictor while every other predictor is held fixed. The coefficient depends on the unit of the predictor, so compare standardized betas when predictors are on different scales.

R² never falls when you add a predictor. Adjusted R² subtracts a penalty for each added predictor and rises only when the new variable improves the fit more than chance would, so use it to compare models of different size.

A VIF of 1 means no overlap with other predictors. Many sources treat 5 or 10 as a prompt to investigate, and some use stricter values such as 3. A high VIF inflates standard errors but does not bias the coefficients or hurt overall prediction.

You need at least k + 2 rows for k predictors, and guides commonly suggest 10 to 20 rows per predictor for stable estimates. The calculator warns when you have fewer than 10 per predictor.

Use text labels in the column, such as Engineering, Sales and Support. The calculator creates one dummy variable for each category except the first alphabetically, which becomes the reference group.

Two predictors are exact copies or one is an exact combination of the others, so XᵀX cannot be inverted. The error message names highly correlated pairs when it can find them. Remove one of the redundant columns.

Not automatically. Add a column in your spreadsheet that multiplies two predictors for an interaction, or squares one predictor for a quadratic term, then include it as another predictor.

No. The calculation runs in your browser with JavaScript, and nothing you paste or upload leaves your device.

The fitting code was compared with NumPy, SciPy and statsmodels on test datasets and matched to at least seven significant figures. It has not been compared with R, SPSS or Stata output.

Multiple regression has one dependent variable and several predictors. Multivariate regression models several dependent variables together. This calculator does the first.