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
| Input | Example value | What to enter |
|---|---|---|
| Observed x values | 1 2 3 | Separate numbers with spaces or semicolons; use a decimal point. |
| Observed y values | 3 5 7 | Separate numbers with spaces or semicolons; use a decimal point. |
| x for fitted value | 4 | Enter a numeric value. |
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