Linear Regression Calculator
Calculate the linear regression equation and correlation coefficient for a set of data points. Enter X and Y values to get slope, intercept, and R².
Was this calculator helpful?
How to use this tool?
This calculator performs simple linear regression on a set of paired data points. Follow these steps:
- Enter X values in the first input field, separated by commas (e.g.,
1,2,3,4,5). - Enter Y values in the second input field, also comma-separated (e.g.,
2,4,5,4,5). - Click "Calculate" to compute the regression line.
Results explained:
- Slope (b): The change in Y for each unit change in X.
- Intercept (a): The predicted Y value when X is 0.
- R²: How well the line fits the data (0 to 1, higher is better).
- Equation: The regression line formula:
y = bx + a.
Requirements:
- X and Y must have the same number of values.
- At least 2 data points are needed.
- All values must be numbers (decimals allowed).
- X values cannot all be identical (need variance).
Previous Results
| Result | Inputs | Date |
|---|
Frequently Asked Questions
Linear regression is a statistical method to model the relationship between a dependent variable (Y) and one independent variable (X) by fitting a linear equation to observed data.
The slope (b) indicates the change in Y for a one-unit change in X. The intercept (a) is the predicted Y value when X = 0.
R² (coefficient of determination) measures how well the regression line fits the data. Values close to 1 indicate a strong fit.