LR

Math & Statistics

Linear Regression Calculator

Fit an ordinary least-squares line through three entered x-y pairs, report slope and intercept, calculate Pearson correlation, and evaluate the fitted line at x = 5. The guidance focuses on residuals, extrapolation, and the limits of a three-point fit.

Regression slope-
Regression intercept-
Correlation coefficient-
Predicted Y at X = 5-

Decision view

Observed points, least-squares line, and prediction

Observed points, least-squares line, and predictionThe three entered coordinate pairs are plotted against the fitted line; the displayed X = 5 prediction is marked beyond or within the observed range.
Exact scenario comparisonX3 changes while all other entered assumptions remain constant.
X3Regression slopeRegression interceptCorrelation coefficientPredicted Y at X = 5

How to use Linear Regression Calculator

  1. Enter three coordinate pairs whose x and y values refer to the same cases and use consistent measurement definitions.
  2. Read the slope as fitted y change per one x unit and the intercept as the fitted y value at x = 0, whether or not zero is meaningful in the observed domain.
  3. Compare fitted values with the three observed y values and treat the prediction at x = 5 as extrapolation whenever 5 lies outside the entered x range.

Calculator guide

Understanding Linear Regression Calculator

Simple linear regression fits the straight line that minimizes the sum of squared vertical residuals. This page uses exactly three coordinate pairs, making it useful for checking the mechanics of slope, intercept, correlation, and a line-based prediction—not for validating a production forecasting model.

Three-point fit Every coefficient is determined from only three entered pairs, so individual points can have very high influence.
Prediction at five The displayed prediction always evaluates the fitted equation at x = 5 rather than at a user-selected x.
Intercept context The coefficient is mathematically required but may lack practical meaning when x = 0 is outside the plausible domain.
Correlation companion Correlation describes standardized linear co-movement; slope additionally depends on the units and relative spread of x and y.

Calculation method

How the calculation works

Fit a least-squares line through three entered coordinate pairs and report slope, intercept, correlation, and an example prediction. Fit a least-squares line through three entered coordinate pairs and report slope, intercept, correlation, and an example prediction.

Model diagnostic

Audit the fitted line before using its prediction

Even a perfectly calculated coefficient can be unsuitable for the intended decision.

Domain Confirm that x = 5 and any future prediction fall within a range where a straight-line relationship is plausible.
Residual pattern Check whether points fall randomly around the line rather than forming a curve or systematic direction.
Influence Recalculate after reviewing unusual x or y values; with three points, one observation can control the line.
Causal claim Identify alternative explanations and study design before interpreting slope as an effect.

Use this page to understand or verify a compact calculation; use a full statistical workflow for inference and forecasting.

Worked situations

Practical examples

  • The default points (1,3), (2,5), and (4,9) lie exactly on y = 2x + 1, so slope is 2, intercept is 1, and correlation is 1.
  • The displayed prediction at x = 5 is then 11, one x unit beyond the largest default observation.
  • Changing the third y value from 9 to 7 tilts the fitted line and creates residuals, so no single pair alone determines the least-squares result.

Better inputs

Useful tips

  • Plot the points and inspect residual direction; a high correlation can coexist with curvature or one influential point.
  • Keep predictions near the observed x range unless a defensible model supports extrapolation.
  • With real datasets, report uncertainty, residual diagnostics, observation count, missing-data rules, and any transformations.

Before relying on the result

Limitations and common mistakes

  • Only three observations are fitted, leaving almost no information for diagnosing variance, nonlinearity, influential cases, or generalization.
  • The page does not calculate residual standard error, R-squared, confidence intervals, prediction intervals, p-values, or weighted regression.
  • A fitted association does not establish causality and may reflect confounding, reverse direction, selection, or shared time trends.

Reference

Key terms

Slope
Fitted change in y associated with a one-unit increase in x.
Intercept
Fitted y value when x equals zero.
Residual
Observed y minus the y value predicted by the fitted line.
Least squares
Criterion that chooses coefficients minimizing the sum of squared vertical residuals.

Important note

Calculated directly from the entered values using the displayed formula and rounding settings.

Frequently asked questions

What equation does the calculator fit?

It fits y = intercept + slope times x by ordinary least squares across the three entered pairs.

What happens if all x values are identical?

Slope is undefined because x has no variation. Use distinct x values or a model appropriate to the data structure.

Is correlation of 1 proof the model will predict perfectly?

No. It indicates exact positive linear alignment in these entered observations, not guaranteed accuracy for new cases.

Why can the intercept be unrealistic?

It is the line's value at x = 0, which may lie outside the observed or physically possible range.