Skip to content
Advertisement
Hosinger Special Offer

Regression Calculator

Regression Calculator from Gizcalc helps you estimate results quickly within the Math & Statistics category.

  • Instant results
  • Charts & tables
  • Save & compare
  • Private – runs in your browser
Regression Equation —

Sample inputs are pre-filled so you can see a result quickly. Results are estimates only and may not be accurate because prices, interest rates, taxes, fees, fuel costs, tariffs, market returns, medical costs, and local rules can change. Please verify current values before making financial, tax, legal, medical, or business decisions.

Formula used

b = Σ(x − x̄)(y − ȳ) ÷ Σ(x − x̄)², a = ȳ − b x̄

  • b = the slope: the change in y for each 1-unit increase in x
  • a = the intercept: the predicted y when x = 0
  • R² = [Σ(x − x̄)(y − ȳ)]² ÷ [Σ(x − x̄)² × Σ(y − ȳ)²]

About the Regression Calculator

What is the Regression Calculator?

Linear regression finds the straight line that best describes how one variable (y) changes with another (x). The “least-squares” line is the one that makes the sum of the squared vertical distances from the points to the line as small as possible.

Enter matching lists of x and y values. The calculator returns the regression equation, the slope and intercept, R² (the share of the variation in y explained by x), a prediction for any x you choose, and a table of fitted values and residuals for every point.

How to use the Regression Calculator

  1. X Values (separated by commas) — the explanatory (independent) variable. (sample: 1, 2, 3, 4, 5, 6)
  2. Y Values (same order) — the response (dependent) variable, in the same order as x. (sample: 2.1, 3.9, 6.2, 7.8, 10.1, 12.2)
  3. Predict Y for this X — the x value to make a prediction for. (sample: 7)
  4. Press Fit Regression Line (results also refresh as you type). The result card shows the Regression Equation, along with Slope (b), Intercept (a), R² (goodness of fit) and Predicted Y at X = 7.

Formula used

b = Σ(x − x̄)(y − ȳ) ÷ Σ(x − x̄)², a = ȳ − b x̄

  • b = the slope: the change in y for each 1-unit increase in x
  • a = the intercept: the predicted y when x = 0
  • R² = [Σ(x − x̄)(y − ȳ)]² ÷ [Σ(x − x̄)² × Σ(y − ȳ)²]

A residual is the actual y minus the fitted y. Residuals that show a pattern (a curve or a funnel) suggest a straight line is not the right model.

Worked example

These are the sample values already filled in the calculator above, and the result it returns for them:

InputSample value
X Values (separated by commas)1, 2, 3, 4, 5, 6
Y Values (same order)2.1, 3.9, 6.2, 7.8, 10.1, 12.2
Predict Y for this X7
ResultValue
Regression Equationy = 2.02x − 0.02
Slope (b)2.02
Intercept (a)-0.02
R² (goodness of fit)0.9982
Predicted Y at X = 714.12

Tips for using the Regression Calculator

  • Be cautious predicting far outside the range of your x data (extrapolation).
  • R² close to 1 means the line fits closely; it does not prove that x causes y.
  • Plot the data first — a single outlier can change the slope a lot.

Frequently asked questions

The proportion of the variation in y explained by the linear relationship with x. R² = 0.9982 means 99.82% of the variation is explained by the line.

Substitute x into y = a + bx. With y = 2.02x − 0.02, x = 7 gives y ≈ 14.12.

Correlation measures the strength and direction of a linear relationship with one number, r. Regression gives the equation of the line so you can predict y from x.

At least two distinct x values are needed to draw a line, but meaningful results need many more — ideally 10 or more points.