Formula Used
The calculator uses least squares linear regression.
Regression equation: ŷ = a + bx
Slope: b = SSxy / SSxx
Intercept: a = ȳ − b x̄
SSxx: Σx² − (Σx)² / n
SSyy: Σy² − (Σy)² / n
SSxy: Σxy − (ΣxΣy) / n
Correlation: r = SSxy / √(SSxx × SSyy)
R²: SSR / SST, or 1 − SSE / SST
Residual: e = y − ŷ
Standard error: s = √(SSE / (n − 2))
How to Use This Calculator
Enter the independent variable values in the X box.
Enter the matching dependent variable values in the Y box.
Keep the same number of entries in both boxes.
Add a prediction X value when you need a forecast.
Enter a t critical value for interval estimates.
Select decimal places for the final output.
Press the calculate button to show results above the form.
Use the CSV or PDF buttons to save the work.
Hand Linear Regression Guide
What Linear Regression Shows
Linear regression studies a straight line relationship between two variables. The x variable is the input. The y variable is the outcome. The goal is to draw the best fitting line through the points. This line helps explain the trend. It also helps predict new values.
Why Hand Calculation Matters
Many tools give only the final answer. That is not enough for learning. A hand style layout shows each sum. It shows x², y², and xy. These columns explain where the slope and intercept come from. Students can check every step. Teachers can also review the work faster.
Main Regression Parts
The slope tells how much y changes when x increases by one unit. A positive slope means y usually rises. A negative slope means y usually falls. The intercept is the estimated y value when x equals zero. It may not always have real meaning. It still helps build the equation.
Fit and Error
Residuals measure the gap between actual y and predicted y. Small residuals suggest a better fit. SSE adds squared residuals. RMSE gives a useful average error size. R squared shows how much variation is explained by the line. A higher value often means stronger fit. It should still be checked with context.
Prediction and Confidence
A prediction uses the regression equation. The calculator can estimate y for a new x value. It can also form intervals with a t critical value. These intervals depend on spread, sample size, and distance from the mean x value. Predictions far from the data center are less stable.
Best Practices
Use enough paired data. Check that values are entered in the right order. Avoid mixing units. Look for outliers before trusting the result. Do not use a straight line when the pattern is curved. Always explain the equation in plain words. This makes the result clearer and more useful.
FAQs
What is linear regression?
Linear regression estimates a straight line relationship between x and y. It finds the line that reduces squared errors between actual and predicted values.
What does the slope mean?
The slope shows the expected change in y for each one unit increase in x. Its sign shows the trend direction.
What does the intercept mean?
The intercept is the predicted y value when x equals zero. It may be meaningful only when zero is realistic for the data.
What is R squared?
R squared shows the share of y variation explained by the regression line. Higher values often show stronger fit.
What is a residual?
A residual is actual y minus predicted y. It shows how far one point is from the fitted line.
Can I use uneven data counts?
No. Each x value must have one matching y value. The calculator stops if the counts are different.
Why enter a t critical value?
The t critical value helps estimate confidence intervals. Use a statistics table based on confidence level and degrees of freedom.
Can this predict future values?
It can estimate y for a new x value. Predictions are safer when the new x stays near the original data range.