calqulio.
◎ English · Global

Simple Linear Regression Calculator

Fit y = mx + b to paired observations by ordinary least squares and evaluate the fitted line at a chosen x.

Enter your values

Separate numbers with spaces or semicolons; use a decimal point.
Separate numbers with spaces or semicolons; use a decimal point.
Enter a numeric value.

Use a decimal point, without thousands separators.

Example result
Slope m
2
Intercept b1
Fitted y at chosen x9

The initial result uses the example values. Enter your own values and calculate again.

Edit inputs

How it works

The lists must have matching lengths, at least two pairs and variation in x. Each pair has equal weight. Points (1, 3), (2, 5), (3, 7) fit y = 2x + 1, giving a fitted value of 9 at x = 4. The line minimizes the sum of squared vertical residuals.

Inputs and units
Simple Linear Regression Calculator · Inputs and units
InputExample valueWhat to enter
Observed x values1 2 3Separate numbers with spaces or semicolons; use a decimal point.
Observed y values3 5 7Separate numbers with spaces or semicolons; use a decimal point.
x for fitted value4Enter a numeric value.
m = Σ((x − x̄)(y − ȳ))/Σ(x − x̄)²; b = ȳ − mx̄; fitted y = mx + b

Worked example

Show example inputs and results

This example is generated by the same calculation engine using the starting values in the form. Your own inputs produce your own result.

Observed x values
1 2 3
Observed y values
3 5 7
x for fitted value
4

Complete example results

Slope m
2
Intercept b
1
Fitted y at chosen x
9

Reading the result

Keep the list to one kind of measurement. Outliers can affect the mean; sample and population formulas use different denominators. The tool applies its stated method and does not establish the quality of your data.

Questions and answers

Can I use the example values for my own calculation?

The example values illustrate the calculation. Replace every input with your own information, especially dates, rates and the selected operation.

Is a fitted value outside the observed range reliable?

It is an extrapolation of the same line, not a validated prediction. This tool does not supply a confidence interval, diagnose residuals or establish a causal relationship.

Why are some results rounded?

Results display up to 8 decimal places. Calculations use the unrounded values; very small values use scientific notation. JavaScript floating-point arithmetic can introduce tiny rounding differences.

Are my inputs sent to a server?

The calculator processes inputs in your browser. Its code does not send your values to a server.

Method sources: itl.nist.gov

Methods & accuracy

What would you like to calculate?

Browse all calculators