Skip to content
FiftyCalc Free calculators for all 50 states

Multiple Regression Calculator

Test cases replayed : 2 of 2 match · Methodology · No outside source listed

Enter up to 8 rows of data, each with two predictors x₁ and x₂ and the outcome y, and say how many rows to use. The calculator fits the least-squares plane y = b₀ + b₁x₁ + b₂x₂ and predicts y for new values.

Result

Sample figures

Predicted y at (x₁, x₂)—

Intercept b₀ —

  • Coefficient b₁ of x₁—
  • Coefficient b₂ of x₂—
  • R² (share of the variance of y explained)—
  • Adjusted R²—
  • Standard error of the regression—

Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.

Multiple Regression Calculator

Number of rows used (4 to 8): enter a number from 4 to 8. Prefilled example: 6.

Row 1: x₁: enter a number. Prefilled example: 1.

Row 1: x₂: enter a number. Prefilled example: 4.

Row 1: y: enter a number. Prefilled example: 10.

Row 2: x₁: enter a number. Prefilled example: 2.

Row 2: x₂: enter a number. Prefilled example: 3.

Row 2: y: enter a number. Prefilled example: 12.

Row 3: x₁: enter a number. Prefilled example: 3.

Row 3: x₂: enter a number. Prefilled example: 5.

Row 3: y: enter a number. Prefilled example: 17.

Row 4: x₁: enter a number. Prefilled example: 4.

Row 4: x₂: enter a number. Prefilled example: 2.

Row 4: y: enter a number. Prefilled example: 15.

Row 5: x₁: enter a number. Prefilled example: 5.

Row 5: x₂: enter a number. Prefilled example: 6.

Row 5: y: enter a number. Prefilled example: 24.

Row 6: x₁: enter a number. Prefilled example: 6.

Row 6: x₂: enter a number. Prefilled example: 3.

Row 6: y: enter a number. Prefilled example: 22.

Row 7: x₁: enter a number. Prefilled example: 0.

Row 7: x₂: enter a number. Prefilled example: 0.

Row 7: y: enter a number. Prefilled example: 0.

Row 8: x₁: enter a number. Prefilled example: 0.

Row 8: x₂: enter a number. Prefilled example: 0.

Row 8: y: enter a number. Prefilled example: 0.

Predict at x₁ =: enter a number. Prefilled example: 4.

Predict at x₂ =: enter a number. Prefilled example: 4.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. Number of rows used (4 to 8): enter a number from 4 to 8.
  2. Row 1: x₁: enter a number.
  3. Row 1: x₂: enter a number.
  4. Row 1: y: enter a number.
  5. Row 2: x₁: enter a number.
  6. Row 2: x₂: enter a number.
  7. Row 2: y: enter a number.
  8. Row 3: x₁: enter a number.
  9. Row 3: x₂: enter a number.
  10. Row 3: y: enter a number.
  11. Row 4: x₁: enter a number.
  12. Row 4: x₂: enter a number.
  13. Row 4: y: enter a number.
  14. Row 5: x₁: enter a number.
  15. Row 5: x₂: enter a number.
  16. Row 5: y: enter a number.
  17. Row 6: x₁: enter a number.
  18. Row 6: x₂: enter a number.
  19. Row 6: y: enter a number.
  20. Row 7: x₁: enter a number.
  21. Row 7: x₂: enter a number.
  22. Row 7: y: enter a number.
  23. Row 8: x₁: enter a number.
  24. Row 8: x₂: enter a number.
  25. Row 8: y: enter a number.
  26. Predict at x₁ =: enter a number.
  27. Predict at x₂ =: enter a number.
  28. Read the result: Predicted y at (x₁, x₂); the panel also shows Intercept b₀, Coefficient b₁ of x₁, Coefficient b₂ of x₂, R² (share of the variance of y explained), Adjusted R² and Standard error of the regression.

How this calculator works

Ordinary least squares chooses b₀, b₁ and b₂ that make the sum of squared residuals Σ(y − b₀ − b₁x₁ − b₂x₂)² as small as possible.

With the centered sums S₁₁ = Σx₁² − (Σx₁)²/n, S₂₂ = Σx₂² − (Σx₂)²/n, S₁₂ = Σx₁x₂ − Σx₁Σx₂/n, S₁y = Σx₁y − Σx₁Σy/n and S₂y = Σx₂y − Σx₂Σy/n, the normal equations give b₁ = (S₁y S₂₂ − S₂y S₁₂) ÷ D and b₂ = (S₁₁ S₂y − S₁₂ S₁y) ÷ D, with D = S₁₁S₂₂ − S₁₂², then b₀ = ȳ − b₁x̄₁ − b₂x̄₂.

R² = regression sum of squares ÷ total sum of squares; adjusted R² = 1 − (1 − R²)(n − 1) ÷ (n − 3); standard error = √(SSE ÷ (n − 3)), with n − 3 degrees of freedom for three fitted coefficients.

Rows beyond the number used are ignored. If x₁ or x₂ is constant, or one is an exact linear function of the other (x₂ = m + k x₁), D = 0 and the coefficients cannot be found (the results show —).

Worked example

Number of rows used (4 to 8)6
Row 1: x₁1
Row 1: x₂4
Row 1: y10
Row 2: x₁2
Row 2: x₂3
Row 2: y12
Row 3: x₁3
Row 3: x₂5
Row 3: y17
Row 4: x₁4
Row 4: x₂2
Row 4: y15
Row 5: x₁5
Row 5: x₂6
Row 5: y24
Row 6: x₁6
Row 6: x₂3
Row 6: y22
Row 7: x₁0
Row 7: x₂0
Row 7: y0
Row 8: x₁0
Row 8: x₂0
Row 8: y0
Predict at x₁ =4
Predict at x₂ =4
Predicted y at (x₁, x₂)18.2394
Intercept b₀1.6338
Coefficient b₁ of x₁2.6426
Coefficient b₂ of x₂1.5088
R² (share of the variance of y explained)0.9969
Adjusted R²0.9948
Standard error of the regression0.3981

Frequently asked questions

How many rows do I need?

At least 4 to have one degree of freedom left; with so few rows the coefficients are very uncertain. Statistical software handles larger data sets and gives p-values.

What does b₁ mean?

The change in y predicted for a one-unit increase in x₁ when x₂ stays the same.

Why is adjusted R² lower than R²?

It charges each predictor one degree of freedom, so adding a predictor raises it only when the gain in fit outweighs that cost.

Questions answered

Related calculators