Regression Calculator
Calculate linear regression equations, find slope and intercept, compute R-squared and correlation, make predictions, and analyze residuals.
📈Regression Calculator
Finds the best-fit line y = a + bx that minimizes squared errors.
How to Use the Regression Calculator
Enter your data points with x and y values, one pair per line. Choose an operation: calculate regression, predict values, or analyze residuals.
Calculator Modes
Linear Regression
Finds the best-fit line through your data using least squares method:
- Equation: y = a + bx (slope-intercept form)
- Slope (b): Change in y per unit change in x
- Intercept (a): y-value when x = 0
- R²: Proportion of variance explained (0 to 1)
- Correlation (r): Strength and direction of relationship (-1 to 1)
Prediction
Use the regression equation to predict y for any given x value. Note: Predictions outside the range of your data (extrapolation) may be less reliable.
Residuals Analysis
Residuals are the differences between actual and predicted values:
- Residual: y - Å· (actual minus predicted)
- SSE: Sum of squared errors (total squared residuals)
- MSE: Mean squared error (average squared error)
- RMSE: Root mean squared error (in same units as y)
Understanding R-Squared
R² (coefficient of determination) indicates how well the model fits:
- R² = 1: Perfect fit (all points on the line)
- R² = 0: Model explains none of the variance
- R² = 0.8: 80% of variance is explained by the model
Common Applications
- Trend analysis and forecasting
- Scientific experiments and research
- Economic modeling and finance
- Quality control and process improvement
- Sports analytics and performance prediction
- Medical research and epidemiology
Data Format
Enter data as x,y pairs, one per line. Accepted formats:
- 1, 2 (comma separated)
- 1 2 (space separated)
- 1 2 (tab separated)
Assumptions of Linear Regression
- Linear relationship between x and y
- Independence of observations
- Homoscedasticity (constant variance of residuals)
- Normally distributed residuals