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.
Related
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.
“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.
You can evaluate the line representing the points by using the following linear regression formula for a given data:
ŷ = bX+a
Where;
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;
here;
SP (∑xy) = (X - Mx)*(Y - My)
SSx (∑x²) = (X - Mx)^2
Let us solve a couple of examples to better understand the linear regression analysis:
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:
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.
Related
Links
Home Conversion Calculator About Calculator Online Blog Hire Us Knowledge Base Sitemap Sitemap TwoEmail us at
Contact Us© Copyrights 2026 by Calculator-Online.net
How was your experience today?
Not now
Awesome! Would you mind sharing that on Trustpilot?
Your review helps others find a tool that actually works.
Write a Review on TrustpilotNot now
Sorry to hear that
Tell us what went wrong — we read every message.
Not now
Thanks for your feedback!
We'll use it to make things better.