Linear regression

Linear regression: use x observations, y observations, x value for prediction. Review the formula, worked example and calculation steps.

Inputs

Use the units shown
RESULT
—

Enter your values and select Calculate.

Formula & explanation
ŷ = intercept + slope × x; ordinary least squares

Variables & units

X observations
comma separated
Y observations
comma separated
X value for prediction
Numeric value · minimum -1000000000000, maximum 1000000000000

Worked example

X=1,2,3 and Y=2,4,6 predicts Y=8 at X=4.

Assumptions

Fits one predictor with an intercept; extrapolation beyond the observed range can be unreliable.

Formula version 1.0.0. JavaScript floating-point arithmetic applies. Results display up to 6 decimal places; stored values retain available precision. Use the units shown.

Practice with an example

Use the default input values to find the answer. The reset icon restores those values.

Calculated on your device. Your latest 100 calculations stay in this browser.