Paired observations, a fitted regression line and residuals shown against a zero reference line.
The residual plot makes patterns around the fitted line easier to inspect.
On this page

What simple linear regression calculates

Simple linear regression fits a straight line of the form ŷ = b₀ + b₁x to paired numeric observations. With an intercept, ordinary least squares chooses the slope and intercept that minimize the sum of squared vertical residuals: each residual is the observed y minus its fitted value. NIST gives the slope as the centered cross-product divided by the centered sum of squares for x, and the intercept as the mean of y minus slope times the mean of x.

This browser tool reports the fitted equation, slope, intercept, R², fitted values for the X values you entered, residuals and a residual standard error. It does not generate estimates for new X values or calculate p-values, confidence intervals or prediction intervals. It also does not choose a model for you.

Supporting reading: [1]

Enter paired observations

Paste two numeric columns with one observation per row. Separate values with a comma, semicolon or tab. The first X value must belong to the first Y value, and every later pair must refer to the same case. If you include column labels, select the option to skip the first row; the calculator will not guess whether a row is a header.

At least three pairs are required. Two points always define a straight line, leaving no information in the residuals for inspecting whether that line describes a broader pattern. This minimum is a practical diagnostic choice for this tool, not a universal sample-size recommendation.

Supporting reading: [1]

Interpret the slope, intercept and R²

The slope describes the fitted change in y for a one-unit increase in x, within the observed range and in the units you entered. State both units when reporting it. The intercept is the fitted y value at x = 0; if zero is outside the observed range or has no meaningful interpretation, it may not answer a useful real-world question.

R² describes the share of variation around the sample mean accounted for by this fitted line in the entered observations. It is a description of this fit, not proof that the model is correct, that X causes Y, or that the relationship will hold for new cases. A curved pattern can produce a low R² even when the variables follow a clear nonlinear relationship.

Supporting reading: [1] [2]

Inspect residuals before using the line

A scatterplot with a fitted line shows the overall trend, but a large trend can hide smaller structure. NIST recommends graphical residual analysis to identify model deficiencies. In the residual plot, look for curvature, changing spread, clusters or a sequence; these patterns can indicate that a straight-line model does not describe the data well or that the observations need closer review.

A residual plot without an obvious pattern does not prove every statistical assumption. The calculator does not test independence, sampling design, measurement quality, influential observations or the appropriateness of your research question. Check unusual points against their original records rather than deleting them to improve the fit.

Supporting reading: [2] [3]

Limits of this calculator

This is a descriptive least-squares calculation for one numeric predictor and one numeric outcome, with an intercept. It does not support weighted, multiple, polynomial or nonlinear regression; it does not estimate uncertainty or establish causation. The residual standard error summarizes residual spread using n − 2 degrees of freedom, but it is not a guarantee that the model assumptions are met.

Use the fitted line to describe the data you entered, not to extrapolate beyond its observed X range without a justified model and context. For a correlation-only summary, use the Pearson calculator; for several numeric variables, categorical predictors or inferential estimates, choose a method that matches the study design and consult appropriate statistical guidance.

Supporting reading: [2]

Free interactive statistics tool

Fit a line and inspect its residuals

Paste paired X and Y values. Review the scatterplot, fitted line and residual pattern together.

Try a constructed example

Your values stay in this browser tab. The calculator does not upload or automatically save them.

A constructed example with 6 pairs is ready. Fit the line to see the equation and residual plots.

Questions about this topic

How do I calculate a simple linear regression line?

Enter matched X and Y values, then calculate. The tool fits ŷ = b₀ + b₁x by minimizing the sum of squared residuals and reports the slope, intercept, R², fitted values and residuals.

What does the slope mean?

The slope is the fitted change in Y for a one-unit increase in X, using the units and range in your data. It does not establish that changing X causes Y to change.

What does R² tell me?

R² describes how much of the variation in the entered Y values is accounted for by the fitted line. A high value does not establish that the model is appropriate or causal; inspect the scatterplot and residuals.

What is a residual in regression?

A residual is an observed Y value minus its fitted value: eᵢ = yᵢ − ŷᵢ. Patterns in residuals can reveal structure that is difficult to see in a scatterplot with a strong overall trend.

Does this calculator report statistical significance or prediction intervals?

No. It reports a descriptive least-squares fit and residual diagnostics for the observations you entered. Fitted values apply only to those rows; the tool does not estimate outcomes for new X values or calculate p-values, confidence intervals or prediction intervals. It cannot verify study-design assumptions.

Can I use the line to predict beyond my observed X values?

The table gives fitted values for the X values already in your data; the tool does not generate estimates for new X values. Extrapolation beyond the observed range requires a justified model and domain knowledge, because your data cannot show that the same line continues outside that range.

Are my data uploaded?

No. The calculation, plots and CSV download run in this browser tab. The tool does not send the entered values to AI Essay.

Sources and editorial notes

The supporting reading below informs our editorial guidance. Exercises and scenarios illustrate a method; they do not report a completed product test or measured learning outcome. Read our editorial policy or send a correction with a supporting source to info@ai-essay.com.

  1. NIST/SEMATECH e-Handbook: Least Squares
  2. NIST/SEMATECH e-Handbook: Linear Least Squares Regression
  3. NIST/SEMATECH e-Handbook: Graphical Residual Analysis