Linear Regression and Prediction Calculator
Fit an ordinary least-squares line to paired data and predict Y for a chosen X, showing slope, intercept, r and R².
YOUR SHORTCUTS
Continue where you left off
Recently used
Your favorites
These shortcuts remember only calculator names on this device, not the values you enter.
Linear Regression and Prediction Calculator
View complete schedule
ⓘ Calculated locally in your browser. Results depend on the values and units you enter.
Explore the calculation visually
The chart follows the current valid inputs and the original calculation engine. It is an illustration, not a separate estimate.
Read the exact figures in the original calculator above. Chart coordinates are rounded for display.
What changes if one input changes?
5: 4.6 · 6: 5.4 · 7: 6.2
This combination has no safe comparable results. Check the inputs above or select another value.
How this calculator works
Ordinary least squares with an intercept minimizes the sum of squared vertical residuals. Slope = Sxy/Sxx and intercept = meanY − slope×meanX. Enter 3–1000 pairs in matching order; provide a target X for the point prediction. Pearson r and R² describe the linear fit, not causal effects or confidence intervals. X must vary; if Y is constant, the fitted line is horizontal and correlation and R² are undefined. Extrapolating outside observed X may be unreliable; predictions do not include uncertainty intervals.
Formula and reasoning
ŷ(x₀) = ȳ + [Σ(xᵢ−x̄)(yᵢ−ȳ) / Σ(xᵢ−x̄)²] × (x₀−x̄)
- 1. Start with the measurementsObserved X values1, 2, 3, 4, 5Observed Y values2, 1, 4, 3, 5Predict Y when X is6
- 2. Substitute into the formula
Observed X values = 1, 2, 3, 4, 5 ? Observed Y values = 2, 1, 4, 3, 5 ? Predict Y when X is = 6
- 3. Check the computed answer
Result for the sample inputs
Worked example
Frequently asked questions
What is R²?
R² is the proportion of sample Y variation explained by the fitted straight line with an intercept.
Is the predicted value guaranteed?
No. It is a model point estimate that does not incorporate prediction uncertainty.
Results are informational and assume the stated inputs and formulas. Double-check critical financial or engineering decisions with a qualified professional.
Was this calculator helpful?
Your feedback helps you keep track of useful tools on this device.
Your selection stays in this browser. No public vote count is shown.
Prefer EverydayCalc on Google
Opens Google source preferences. Availability and placement are determined by Google; this does not guarantee higher rankings.