Simple Regression Calculator

This simple regression calculator fits y on x and gives the equation, r, R², the slope test and confidence interval, an ANOVA table and a prediction interval.

Checks on your data

  • Simple regression assumes a roughly straight-line relationship, independent observations and residuals with similar spread. Check the residual plot.
  • Predictions outside the range of your x values (extrapolation) are much less reliable.

Results

Regression equation
y = 0.06 + 2.00727x
Slope b₁
2.0072727
Intercept b₀
0.06
Correlation r
0.998925
R²
0.997852
Standard error of the estimate
0.29909
Slope standard error
0.0329287
Slope t statistic
60.9582
Slope p-value
5.8291 × 10^-12
95% CI for the slope
1.93134 to 2.08321
Predicted y at x = 11
22.14
95% CI for the mean response
21.6688 to 22.6112
95% prediction interval
21.3047 to 22.9753
Data with the regression line
1020246810xy
Residuals (should look random around 0)
0246810xresidual
ANOVA for the regression
SourceSSdfMSFp
Regression332.4041332.4043715.95.8290 × 10^-12
Residual0.71563680.0894545
Total333.129
Show step-by-step solution
  1. Means: x̄ = 5.5, ȳ = 11.1. Sxx = 82.5, Sxy = 165.6, Syy = 333.12.
  2. Slope b₁ = Sxy ÷ Sxx = 2.0072727; intercept b₀ = ȳ − b₁x̄ = 0.06.
  3. R² = 0.997852; SSE = 0.71563636; standard error of the estimate = √(SSE ÷ 8) = 0.29909.
  4. Slope t = b₁ ÷ SE(b₁) = 60.9582 with 8 df, so p = 5.8291 × 10^-12.
  5. At x = 11: ŷ = 22.14, with a 95 % prediction interval of 21.3047 to 22.9753.
SlopeSxy / Sxx
Interceptȳ − b₁x̄
R²Share explained
Slope testt with n − 2 df

What Is Simple Regression?

Simple regression models a response y as a straight-line function of one predictor x. The least squares line minimises the squared vertical distances to the points.

Paste paired x and y values to get the equation, correlation, R², standard error of the estimate, slope standard error, t statistic, p-value and a confidence interval for the slope. An ANOVA table, a residual plot and an optional prediction with confidence and prediction intervals are included.

The sections below give the formulas, a worked example and answers on testing the slope.

How to Use the Simple Regression Calculator

  1. Enter paired x and y values.
  2. Optionally enter an x to predict.
  3. Read the equation, r and R².
  4. Check the slope test, ANOVA table and residual plot.

Simple Regression Formula

Slope

b1=SxySxxb_1=\frac{S_{xy}}{S_{xx}}

Intercept

b0=yˉ−b1xˉb_0=\bar y-b_1\bar x

Slope t

t=b1SE(b1),SE(b1)=seSxxt=\frac{b_1}{SE(b_1)},\quad SE(b_1)=\frac{s_e}{\sqrt{S_{xx}}}

Simple Regression Variables Explained

SymbolMeaningNotes
b₁Slope
b₀Intercept
R²Share of variation explained
s_eStandard error of the estimate

Simple Regression Worked Example

For x = 1..10 and the y values above, the slope is about 2.0 and R² is above 0.99. The slope t statistic is large and the p-value is far below 0.05, so there is strong evidence of a linear relationship.

With the example values loaded in the calculator above, the steps are:

  1. Means: x̄ = 5.5, ȳ = 11.1. Sxx = 82.5, Sxy = 165.6, Syy = 333.12.
  2. Slope b₁ = Sxy ÷ Sxx = 2.0072727; intercept b₀ = ȳ − b₁x̄ = 0.06.
  3. R² = 0.997852; SSE = 0.71563636; standard error of the estimate = √(SSE ÷ 8) = 0.29909.
  4. Slope t = b₁ ÷ SE(b₁) = 60.9582 with 8 df, so p = 5.8291 × 10^-12.
  5. At x = 11: ŷ = 22.14, with a 95 % prediction interval of 21.3047 to 22.9753.

Result: Regression equation = y = 0.06 + 2.00727x; Slope b₁ = 2.0072727; Correlation r = 0.998925; Predicted y at x = 11 = 22.14.

How to Read a Simple Regression

The slope says how much y changes, on average, for a one-unit rise in x. R² says what share of the variation in y the line explains, so an R² above 0.99 means points sit very close to the line.

The slope test asks whether the true slope could be zero. A large t statistic and a p-value far below 0.05 give strong evidence of a linear relationship. A significant slope does not show that x causes y. The standard error of the estimate gives the typical miss in the units of y.

Where Simple Regression Is Used

Trend and prediction

Fit a line and predict y at a new x within the data range.

Testing a slope

Check whether the relationship is statistically significant.

Model fit

Read R² and the standard error of the estimate.

ANOVA table

See the regression sums of squares and the F test.

Common Simple Regression Mistakes to Avoid

  • Check the scatter plot for curves and outliers before you trust the line.
  • Do not predict far outside the range of x.
  • A high R² does not prove causation.
  • The tests assume residuals that are roughly normal with constant spread.

Simple Regression Terms and Definitions

Residual
Observed y minus predicted y.

Simple Regression FAQs

What is simple regression?

It is a line y = b₀ + b₁x fitted to data with one predictor. The coefficients minimise the sum of squared vertical errors.

How do I test the slope?

Divide the slope by its standard error to get a t statistic with n − 2 degrees of freedom, then read the p-value. A p-value below your α is evidence that the slope is not zero.

What does R² mean?

It is the proportion of the variation in y explained by the line. An R² of 0.80 means 80% of the variation is explained.

Prediction interval or confidence interval?

A confidence interval is for the average y at a given x. A prediction interval is for a single new y and is wider, because it includes the scatter of individual points.

Related calculators

Last updated 2026-11-09. See our disclaimer.