Enter Paired Data
Use one X,Y pair per line. You can paste values from a spreadsheet using commas, tabs, spaces, or semicolons.
Example Data Table
| Observation | X | Y |
|---|---|---|
| 1 | 1.0 | 2.4 |
| 2 | 2.0 | 3.1 |
| 3 | 3.0 | 3.9 |
| 4 | 4.0 | 5.2 |
| 5 | 5.0 | 5.8 |
| 6 | 6.0 | 7.1 |
Formula Used
For a straight-line model, the fitted equation is:
ŷ = a + bxSlope:
b = Sxy / SxxIntercept:
a = ȳ − b x̄Supporting sums:
Sxx = Σ(x − x̄)² Sxy = Σ(x − x̄)(y − ȳ)Goodness of fit:
R² = 1 − SSE / SST SSE = Σ(y − ŷ)² RMSE = √(SSE / (n − 2))Prediction intervals use the fitted line, model error, leverage at the requested X value, and a t critical value for the chosen confidence level.
How to Use This Calculator
- Enter one X,Y pair on each line in the data box.
- Choose a delimiter or leave the tool on auto detect.
- Set decimal places and your preferred confidence level.
- Optionally enter an X value for prediction and intervals.
- Press Calculate Linear Fit to view results above the form.
- Review the equation, fit metrics, residual table, and graphs.
- Use the CSV button for data export and PDF for a report snapshot.
- Check residuals before trusting the straight-line assumption.
Frequently Asked Questions
1. What does a linear fit calculator do?
It finds the straight line that best describes paired numerical data. The tool reports slope, intercept, correlation, R², prediction values, residuals, and error measures.
2. What is the meaning of slope?
Slope shows how much Y is expected to change when X increases by one unit. A positive slope means Y tends to rise as X rises.
3. What does the intercept represent?
The intercept is the predicted Y value when X equals zero. It is useful only when zero is meaningful within your data context.
4. Why is R² important?
R² shows how much of the variation in Y is explained by the fitted line. Values closer to 1 indicate a stronger straight-line fit.
5. What are residuals?
Residuals are the differences between observed Y values and fitted Y values. They help you judge whether a linear model is appropriate.
6. When should I use prediction intervals?
Use prediction intervals when estimating the likely range for a single future observation. They are wider than mean confidence intervals because they include random observation noise.
7. Can I paste spreadsheet data directly?
Yes. Paste two columns copied from a spreadsheet. Tabs, commas, spaces, and semicolons are supported, and auto detect usually works well.
8. When is a linear model a poor choice?
A linear model may be poor when the pattern is curved, residuals show structure, outliers dominate the fit, or the relationship changes across the range.