Skip to content
MoneyDeck

Multiple Linear Regression Calculator

Fit Y on several predictors and see every coefficient, p-value and R²

Updated · Free, no signup

Put the response Y first on each line, then the predictors, separated by commas, spaces or tabs.

One name per column, Y first. Leave blank to use Y, X1, X2, …

One value per predictor, in the same order, e.g. "15, 9".

Fitted equation

Sales = 219.3633 + 5.4866·Ad spend − 4.3217·Price

R²

0.9971

Adjusted R²

0.9962

F statistic

1,190.2833

p-value of the F-test

0

Residual standard error

1.3628

Intercept b₀

219.3633

Coefficient b₁ (first predictor)

5.4866

Coefficient b₂ (second predictor)

-4.3217

Predicted Y

262.7672

Observations (n)

10

Predictors (k)

2

  • The model explains 99.71% of the variation in Sales (adjusted R² 0.9962); overall F-test p < 0.0001.
  • Holding the other predictor constant, a one-unit increase in Ad spend changes Sales by 5.4866 on average.

Observed vs fitted values

Coefficients

TermCoefficientStd errortp-value95% CI low95% CI high
Intercept219.36327538.1329595.75260.0007129.1932309.5334
Ad spend5.4866390.40440613.5672< 0.00014.53046.4429
Price-4.3217433.521061-1.22740.2593-12.64774.0042

About the Multiple Linear Regression Calculator

This multiple linear regression calculator fits an equation of the form Ŷ = b₀ + b₁X₁ + b₂X₂ + … to your data by ordinary least squares. Paste one observation per line with the response Y first and the predictors after it, and it returns the fitted equation, every coefficient with its standard error, t-statistic, p-value and 95% confidence interval, plus R², adjusted R², the residual standard error and the overall F-test. Enter a set of X values to get a prediction from the fitted model.

Multiple regression is the standard way to estimate the effect of one variable while holding others constant — how sales respond to advertising after allowing for price, how house prices depend on size and age, or how exam results relate to study hours and attendance. Students can use it to check textbook and homework answers, and analysts can use it for quick models without opening Excel’s LINEST or a statistics package. Up to 8 predictors and 1,000 rows are supported.

The usual assumptions apply: a linear relationship, independent observations, roughly constant variance of residuals and, for the p-values and intervals, approximately normal residuals. Predictors that are perfect linear combinations of each other (perfect multicollinearity) make the coefficients impossible to estimate, and the calculator tells you when that happens.

How to use the multiple linear regression calculator

  1. 1Arrange your data with one observation per line: Y first, then each predictor.
  2. 2Paste the rows into the data box (commas, spaces or tabs all work, so you can copy from a spreadsheet).
  3. 3Optionally name the variables and enter X values to predict.
  4. 4Read the fitted equation, R² and F-test, then check each coefficient’s p-value and confidence interval in the table.

Formula and method

b = (XᵀX)⁻¹ Xᵀy R² = 1 − SSE/SST adj R² = 1 − (1 − R²)(n − 1)/(n − k − 1) SE(bⱼ) = √(s² · [(XᵀX)⁻¹]ⱼⱼ), s² = SSE/(n − k − 1) F = (SSR/k) ÷ s²

The design matrix X has a column of ones for the intercept followed by one column per predictor. Ordinary least squares chooses the coefficients that minimise the sum of squared residuals, and the solution is given by the normal equations b = (XᵀX)⁻¹Xᵀy. Each coefficient is the expected change in Y for a one-unit change in that predictor while the other predictors are held fixed.

The residual variance s² = SSE/(n − k − 1) gives the standard error of each coefficient from the diagonal of (XᵀX)⁻¹; dividing a coefficient by its standard error gives a t-statistic with n − k − 1 degrees of freedom, and the 95% confidence interval is b ± t₀.₉₇₅·SE. The F-test compares the explained variation per predictor with the residual variance to test whether all slopes are zero at once. Adjusted R² penalises extra predictors so models with different k can be compared.

y
Vector of observed responses
X
Design matrix: a column of 1s plus one column per predictor
b
Vector of estimated coefficients (b₀ intercept, b₁ … b_k slopes)
n, k
Number of observations and number of predictors
SSE, SST, SSR
Residual, total and regression sums of squares (SSR = SST − SSE)

Worked examples

Weekly sales vs ad spend and price

Ten weeks of sales are regressed on ad spend and price. Each extra unit of advertising adds about 5.49 to sales with price held constant, while a $1 price rise cuts sales by about 4.32 — though that price effect is not significant (p ≈ 0.26) because price and ad spend are strongly correlated (r ≈ −0.95). Together the predictors explain 99.7% of the variation (F ≈ 1,190), and at ad spend 15 and price 9 the model predicts sales of about 262.8.

Exact fit check: Y = 1 + 2·X1 + 3·X2 plus small noise

Data generated from Y = 1 + 2X₁ + 3X₂ with tiny errors recover coefficients of 0.975, 1.96 and 3.06 — very close to 1, 2 and 3 — with R² ≈ 0.9996, and predict 26.1 at X₁ = X₂ = 5 (the true value is 26). This is a quick way to confirm you have set up the columns correctly.

Simple regression as a special case

With a single predictor the calculator reduces to ordinary simple linear regression: score = 57.3 + 3.45 × hours, R² ≈ 0.996. Seven hours of study predicts a score of 57.3 + 3.45 × 7 = 81.45.

Frequently asked questions

How do I interpret a coefficient in multiple regression?+

Each slope is the average change in Y for a one-unit increase in that predictor while all the other predictors in the model are held constant. The intercept is the predicted Y when every predictor equals zero, which may not be meaningful.

What is the difference between R² and adjusted R²?+

R² is the share of the variation in Y explained by the model and never falls when you add predictors. Adjusted R² penalises each extra predictor, so it can fall when a new variable adds little; use it to compare models with different numbers of predictors.

What does the F-test tell me?+

The overall F-test checks whether at least one predictor has a non-zero slope. A small p-value means the model as a whole explains significantly more variation than a model with only an intercept.

How many observations do I need?+

You need more observations than coefficients (n > k + 1) to estimate anything, but a common rule of thumb is at least 10 to 20 observations per predictor for stable estimates and trustworthy p-values.

What is multicollinearity?+

Multicollinearity means predictors are highly correlated with one another. It inflates standard errors and makes individual coefficients unstable even when the overall fit is good. Perfect collinearity makes the model impossible to fit.

Does this match Excel’s LINEST or the Data Analysis regression tool?+

Yes. Both use ordinary least squares with an intercept, so the coefficients, standard errors, R², F statistic and residual standard error match. Note that LINEST lists the coefficients in reverse order.

Related tools