Calculator-Online.net

Calculator Online

Calculator-Online.net

Calculator Online

Follow Us On:

Your Result is copied!

Linear Regression Calculator

Enter your X and Y data points separated by commas, then click "CALCULATE" to get a step-by-step solution and generate the line equation.

Advertisement
Advertisement

Linear Regression Calculator

The linear regression calculator find the linear regression by using the least square method. Get instant calculations for a line of best fit along with graphical interpretation.

What Is Linear Regression?

“Linear regression is the predictive analysis in which the value of a variable is predicted by considering another variable”.

A linear regression always shows that there is a linear relationship between the variables. To readily get the linear regression calculations, our linear regression calculator is the most trusted tool that you can rely on.

Linear Regression Formula:

You can evaluate the line representing the points by using the following linear regression formula for a given data:

ŷ = bX+a

Where;

  • ŷ = dependent variable to be determined
  • b= slope of the line
  • X = independent variable
  • a = intercept (the value of y when X = 0)

A regression equation calculator uses the same mathematical expression to predict the results. You can determine the value of a and b by subjecting them to the following equations:

a = MY − (b × MX)

Where;

  • Mx = mean value for x
  • My = mean value for y
  • Value of b = SP/SSx W

here;

SP (∑xy) = (X - Mx)*(Y - My)

SSx (∑x²) = (X - Mx)^2

How To Find Line of Best Fit?

Let us solve a couple of examples to better understand the linear regression analysis:

Example:

Find the least squares regression line for the data set as follows:

{(2, 9), (5, 7), (8, 8), (9, 2)}.

Also, work for the estimated value of y for the value of X to be 2 and 3.

Solution:

  • Sum of X = 24
  • Sum of Y = 26

The mean is evaluated as:

Mean of X = Mx = 2 + 5 + 8 + 9/4 = 6

Mean of Y = My = 9 + 7 + 8 + 2/4 = 6.5

Now, we have to calculate the following quantities:

X - Mx Y - My (X - Mx)² (X - Mx)*(Y - My)
-2.5 -2.5 6.25 6.25
-0.5 0.5 0.25 -0.25
0.5 -0.5 0.25 -0.25
2.5 2.5 6.25 6.25

SSx (∑x²) = (X - Mx)2 = 16+1+4+9 = 30

SP (∑xy) = (X - Mx)*(Y - My) = -10-0.5+3-13.5 = -21

Now, we have to determine the linear regression equation:

ŷ= bX+a

Determining the value of a and b as follows:

b = SP/SSx = -21 / 30 = -07

a = MY−(b×MX) = 6.5 - (-.07 * 6) =10.7

Now, putting all the values in linear regression formula:

ŷ = -0.7x + 10.7

For given values of X, the estimated values of Y are as follows:

X Estimated Y
2 3.22
5 6.485

The graphical plot of the line of best fit clearly shows the trend of the dataset, helping visualize the relationship between X and Y.

animal image
sales modal popup close

Easter into Action, Save With Satisfaction

UPTO

50 %

OFF

Online Calculator

Calculator Online

Get the ease of calculating anything from the source of calculator online

Email us at

Contact Us

© Copyrights 2026 by Calculator-Online.net