Fit a least-squares line and report the slope, intercept, and coefficient of determination.
| Slope | – |
| Intercept | – |
| R² | – |
Use this calculator to fit a straight line y ≈ intercept + slope × x to paired observations. Typical uses are calibration lines, trend of a score with time, or a simple prediction sketch.
The line minimises the sum of squared vertical residuals. Slope = Sxy / Sxx and intercept = ȳ − slope × x̄. R² is the square of Pearson's r here (the share of y variance along the line). The default pairs give a clear upward slope and R² near 0.81.
This is ordinary least squares for one predictor, not multiple regression, and not a robust fit against outliers. x needs some spread. A high R² is not proof of a causal line.
x values: Predictor values, comma- or space-separated.
y values: Response values, same length as x, in the same order.
Slope: Change in y per one-unit change in x.
Intercept: Predicted y when x = 0.
R²: Coefficient of determination, from 0 to 1.
Related calculators