Tool

Paste your data

Y = b0 + b1X1 + … + bkXk

Paste a table with one column per variable and a header row in the first line. Columns can be separated by tabs, commas, semicolons, or spaces, so you can paste straight from Excel or Minitab. Then choose the response (Y) and the predictors (X).

Predictors (X), up to 6

Everything runs in your browser; nothing is sent to a server, and entries are not saved. The examples are made-up data from the Simple Linear Regression and Multiple Regression pages in Stat Dojo.

Model

How well does the model fit?

R-squared
--
Adjusted R-squared
--
Predicted R-squared
--
S (typical residual)
--
F statistic
--
p-value (model)
--
Enter data to see the equation.

Picture

Data and fitted line

Coefficients

Analysis of variance

Predict a new value

Enter values for the predictors. The calculator gives the fitted value, a 95% confidence interval for the average response at those settings, and a 95% prediction interval for a single new observation.

Check the model

Instructions

How to use this calculator

  1. Paste your data with a header row, or load one of the examples.
  2. Choose the response (Y), and tick the predictors (X) you want in the model.
  3. Read R-squared, adjusted and predicted R-squared, and S. A large gap between R-squared and predicted R-squared warns of overfitting.
  4. In the coefficient table, a small p-value means the predictor adds to the model with the others held constant. A VIF above 5 means it overlaps with other predictors.
  5. Look at the two residual plots. A curve, a funnel, or a point far from the line means the model needs attention.
  6. Use the prediction panel only inside the range of your data.

What This Regression Calculator Does

Paste a table of data, choose the response and the predictors, and the calculator fits a least squares regression with up to six predictors. It reports R-squared, adjusted and predicted R-squared, S, the F test, a coefficient table with intervals and VIF, an ANOVA table, and predictions with confidence and prediction intervals.

It also draws the fitted line with its bands (for one predictor) or observed against fitted values, shows the two residual plots, and flags unusual observations, correlated predictors, and extrapolation. It matches the worked examples on the Simple Linear Regression and Multiple Regression pages in Stat Dojo, and agrees with Excel’s Regression tool and Minitab’s Fit Regression Model.

How the Calculation Works

OutputCalculationWhat it tells you
Coefficientsb = (X′X)−1 X′yLeast squares estimates of the intercept and slopes
S√(SSE / (n − k))Typical size of a residual
R-squared and adjusted1 − SSE/SST; adjusted for the number of termsShare of variation explained
Predicted R-squared1 − PRESS/SST, using leave-one-out residualsFit to new data; guards against overfitting
t test for each termb / SE(b), with n − k degrees of freedomDoes the predictor add to the model with the others held constant?
F test(SSR/(k−1)) / MSEDo the predictors together explain more than chance?
VIF1 / (1 − Rj²), from the predictor correlation matrixHow much a predictor overlaps with the others
Confidence and prediction intervalfit ± t √(MSE h) and fit ± t √(MSE (1 + h))Where the average, and a single new observation, will fall

Worked Example

The first example is 12 adhesive bonds with curing temperature and strength. The calculator gives strength = −3.77 + 0.1990 × Temp, R-squared 87.5%, S = 1.42 N, with a slope p-value below 0.0001. At 150 °C the fit is 26.08 N, with a 95% confidence interval for the mean of 25.16 to 27.00 N and a prediction interval for one bond of 22.78 to 29.38 N.

The second example has three predictors. All three look significant alone, but with all in the model the dwell-time coefficient has p = 0.49 and the largest VIF is 2.03. Untick Dwell to refit with Temp and Pressure only: adjusted R-squared rises from 94.3% to 94.5%, and predicted R-squared from 93.3% to 93.7%. The Multiple Regression page explains why.

Limits and Good Practice

Regression Calculator Frequently Asked Questions

How many rows do I need?

You need more rows than predictors plus one for the calculation to run, but a common guide for a reliable model is 10 to 15 observations per predictor. The calculator warns when you have fewer.

What is the difference between the confidence interval and the prediction interval?

The confidence interval is for the average response at the settings you enter. The prediction interval is for a single new observation, so it also includes the scatter of individual results around that average, and is wider.

Why do I get an error that the model cannot be fitted?

Usually two predictors are perfectly correlated (for example, one is a multiple of another), or one predictor is constant. Remove one of the offending columns.

Can I include a squared term or an interaction?

Yes. Add a column to your data with the squared value, or the product of two predictors, and tick it as another predictor. Keep the original predictors in the model when you keep a squared or interaction term.

Is my data stored anywhere?

No. The calculator runs in your browser, nothing is sent to a server, and your entries are not saved when you leave the page.