How to use it
- 1Enter the X values and the matching Y values, or load the example.
- 2Read the regression equation, the slope, the intercept and R².
- 3Check the scatter plot with the fitted line.
- 4Enter an X value to predict Y, then copy the results.
Least-squares regression
Simple linear regression fits the straight line ŷ = a + bx that minimizes the sum of squared vertical distances between the points and the line. The slope is b = Σ(x − x̄)(y − ȳ) / Σ(x − x̄)² and the intercept is a = ȳ − b·x̄.
The slope tells you how much Y changes, on average, when X increases by one unit. The intercept is the predicted Y when X equals zero.
R² and predictions
R² (the coefficient of determination) ranges from 0 to 1 and gives the share of the variation in Y explained by the line. Predictions are most reliable inside the range of observed X values; the calculator flags extrapolation because the same linear trend may fail outside the observed range. Outliers can change the fitted line. This tool provides point estimates and predictions. Inference about coefficients or future observations requires a separate model and assumptions about the errors.
Frequently asked questions
What if all X values are the same?
A vertical set of points has no defined slope, so the calculator asks for X values that vary.
What if all Y values are the same?
The fitted line is horizontal (slope 0) and R² is not defined, because there is no variation in Y to explain.
Is a high R² proof that the model is right?
No. Check the scatter plot for curves and outliers, and keep in mind that a good fit does not prove causation.