Linear Regression Calculator
Calculate linear regression with step-by-step solutions. Find slope, intercept, correlation coefficient (r), and R-squared with scatter plot visualization.
Enter Data Points
What is Linear Regression?
Linear regression is a statistical method for modeling the relationship between a dependent variable (y) and one or more independent variables (x). Simple linear regression uses one independent variable and finds the line y = bx + a that best fits the data by minimizing the sum of squared differences between observed and predicted values.
Linear regression finds the best-fitting straight line through a set of data points. Use our free calculator to calculate the slope, intercept, correlation coefficient (r), and R-squared value. Simply enter your x,y data points and get the regression equation with detailed step-by-step calculations and an interactive scatter plot.
Key Facts About Linear Regression
- *The regression line minimizes the sum of squared residuals (least squares)
- *Slope (b) tells you how much y changes for each unit increase in x
- *Intercept (a) is the predicted y value when x equals zero
- *Correlation coefficient (r) ranges from -1 to +1, measuring linear relationship strength
- *R-squared (R^2) is the proportion of variance in y explained by x
- *R^2 = r^2 for simple linear regression
- *Residuals are the differences between actual and predicted y values
- *A perfect fit has R^2 = 1 and all residuals equal zero