This calculator allows you to input a series of (x, y) data points and compute a linear regression model using the least squares method. In this linear regression model, x is the independent variable, and y is the dependent variable. After entering the number of data points (if you have one x value and its corresponding y value is considered 1 data point), a table will appear where you can input the x and y values.
Once submitted, the tool will display a scatter plot with the best-fit regression line, along with the equation of the line, the correlation coefficient (r), and the coefficient of determination (r²).
Linear Regression Calculator
Below is a linear regression calculator. It gives the equation of the linear regression line, the
Enter the number of data points:
Linear regression is a statistical technique used to model the relationship between a dependent variable y and an independent variable x by fitting a straight line to the observed data. It helps to predict values and identify trends.
The method used above is the least square method. The least squares method minimizes the sum of the squares of the differences between the observed values and the values predicted (of y) by the model. This approach ensures the best possible linear fit to the data.
Correlation Coefficient: r and r2
The correlation coefficient (r) measures the strength and direction of the linear relationship between x and y. It ranges from -1 to 1.
The closer the r value to 1, the better the positive correlation.
The closer the r value to -1, the better the negative correlation.
r² indicates how well the regression line fits the data. An r² value closer to 1 means a better fit.
How to use the calculator
Watch the video to check out how to use linear regression calculator.