Fundamentals of Business Mathematics and Statistics · Correlation and Regression
Regression Lines and Equations: Y on X and X on Y
Updated 10 October 2026 · Fact-checked
A regression line is the best-fitting straight line that estimates one variable from another. The line of Y on X predicts Y from X: Y − Ȳ = byx(X − X̄). The line of X on Y predicts X from Y. Find the means and the regression coefficient, then substitute.
Understand Regression Lines and Equations
Correlation tells you whether two variables move together and how strongly. Regression goes one step further. It gives you an equation so you can estimate the value of one variable when you know the other.
There are two lines. The regression line of Y on X treats X as the known (independent) variable and Y as the one to be estimated. The regression line of X on Y does the opposite. They are different lines, because each one is fitted to minimise a different set of errors.
The method of least squares picks the line so that the sum of the squared vertical gaps between the actual Y values and the line is as small as possible. For Y on X, the gaps are measured in the Y direction. For X on Y, they are measured in the X direction. This is why you cannot just rearrange one equation to get the other, except when r = ±1, when both lines coincide.
Both lines pass through the point (X̄, Ȳ), the means. That is why the equations are written around the means. The slope of each line is a regression coefficient: byx for Y on X and bxy for X on Y. Both have the same sign as r.
Use the line for prediction only within or near the range of the given data, and only to estimate the dependent variable of that line.
Key formulas to remember
- Regression line of Y on X
- Y − Ȳ = byx (X − X̄)
- Use to estimate Y when X is given.
- Regression line of X on Y
- X − X̄ = bxy (Y − Ȳ)
- Use to estimate X when Y is given.
- byx from raw data
- byx = [n ΣXY − ΣX ΣY] ÷ [n ΣX² − (ΣX)²]
- The denominator uses the X column.
- bxy from raw data
- bxy = [n ΣXY − ΣX ΣY] ÷ [n ΣY² − (ΣY)²]
- The denominator uses the Y column. The numerator is the same as for byx.
- Coefficients using r and standard deviations
- byx = r × σy ÷ σx ; bxy = r × σx ÷ σy
- Use when r and the standard deviations are given.
- Link with correlation
- r² = byx × bxy ; r = ±√(byx × bxy)
- r takes the common sign of byx and bxy. Product of the coefficients cannot exceed 1.
- Normal equations for Y = a + bX
- ΣY = na + bΣX ; ΣXY = aΣX + bΣX²
- Solve the two equations for a and b. This is the least squares method.
- Intersection of lines
- Both lines pass through (X̄, Ȳ)
- Solve the two line equations together to get the means.
How to solve Regression Lines and Equations questions
Use this order for any numerical on regression equations. It works for raw data and for questions that give summary values.
- 1Read which line is asked: Y on X (estimate Y) or X on Y (estimate X).
- 2Find n, ΣX, ΣY, ΣXY and ΣX² (and ΣY² if X on Y is needed). Tabulate if raw data is given.
- 3Compute the means X̄ = ΣX ÷ n and Ȳ = ΣY ÷ n.
- 4Compute the required regression coefficient using the raw-data formula, or r × σ ratio if r and σ are given.
- 5Write the line: Y − Ȳ = byx(X − X̄), or X − X̄ = bxy(Y − Ȳ).
- 6Simplify to the form Y = a + bX (or X = a + bY).
- 7Substitute the given value to predict. Use the line whose dependent variable is the one you want.
- 8Check: the sign of b matches the trend in the data, and byx × bxy is not more than 1.
Quickest way: Means plus one coefficient
When to use it: Use for MCQs where data is small or summary values are given, and you must pick one option fast.
- Find X̄ and Ȳ first. Many options can be eliminated because the line must pass through (X̄, Ȳ): put the means into each option.
- Compute only the coefficient the question needs. The numerator n ΣXY − ΣX ΣY is shared, so find it once if both lines are needed.
- If two lines are given and you must identify which is which, assume one is Y on X, find both coefficients, and check that their product is at most 1. If it is more than 1, swap the roles.
- To find the means from two given lines, solve them as simultaneous equations.
- To predict, put the value into the right line. Do not rearrange the other line.
Common mistakes in Regression Lines and Equations
Using the Y on X line to estimate X (or the reverse).
Students rearrange one equation to make the other variable the subject.
Fix: Estimate Y from X with the line of Y on X, and X from Y with the line of X on Y. Choose the line by the dependent variable.
Using ΣX² in the denominator of bxy.
The numerator is the same for both coefficients, so the denominators get mixed up.
Fix: byx has the X column in the denominator. bxy has the Y column. Say it as 'divide by the variable you are predicting from'.
Forgetting to subtract (ΣX)² and writing nΣX² − ΣX² or ΣX² − ΣX².
Rushing with the formula.
Fix: Write n ΣX² − (ΣX)² with brackets. Square the total of the column, not the squares of each item.
Giving r a positive sign when both coefficients are negative.
Taking the square root of r² and ignoring the sign.
Fix: r has the same sign as byx and bxy. Both negative means r is negative.
Mixing up which given line is Y on X when two equations are provided.
Students assume the first equation is always Y on X.
Fix: Try one assumption and compute byx × bxy. If it exceeds 1, the assumption is wrong, so swap them.
Writing the line without the means, such as Y = byx X.
Forgetting that the line has an intercept.
Fix: Always start from Y − Ȳ = byx(X − X̄), then simplify.
Worked examples
Example 1
For five pairs of values, X: 1, 2, 3, 4, 5 and Y: 2, 4, 5, 4, 5, find the regression line of Y on X and estimate Y when X = 6. Also find the line of X on Y.
Show the solution
- n = 5, ΣX = 15, ΣY = 20.
- ΣXY = 1×2 + 2×4 + 3×5 + 4×4 + 5×5 = 2 + 8 + 15 + 16 + 25 = 66.
- ΣX² = 1 + 4 + 9 + 16 + 25 = 55. ΣY² = 4 + 16 + 25 + 16 + 25 = 86.
- X̄ = 15 ÷ 5 = 3 and Ȳ = 20 ÷ 5 = 4.
- Numerator = nΣXY − ΣXΣY = 5×66 − 15×20 = 330 − 300 = 30.
- byx = 30 ÷ (5×55 − 15²) = 30 ÷ (275 − 225) = 30 ÷ 50 = 0.6.
- Y − 4 = 0.6(X − 3), so Y = 0.6X + 2.2.
- At X = 6: Y = 0.6×6 + 2.2 = 5.8.
- bxy = 30 ÷ (5×86 − 20²) = 30 ÷ (430 − 400) = 30 ÷ 30 = 1.
- X − 3 = 1(Y − 4), so X = Y − 1.
Answer: Y on X: Y = 0.6X + 2.2, estimated Y at X = 6 is 5.8. X on Y: X = Y − 1.
Example 2
The two regression lines are 3x + 2y = 26 and 6x + y = 31. Find the means of x and y and the correlation coefficient.
Show the solution
- Both lines pass through the means, so solve them together.
- From 6x + y = 31, y = 31 − 6x.
- Put into 3x + 2y = 26: 3x + 62 − 12x = 26, so −9x = −36 and x = 4.
- Then y = 31 − 24 = 7. So x̄ = 4 and ȳ = 7.
- Assume 3x + 2y = 26 is y on x: y = 13 − 1.5x, so byx = −1.5.
- Then 6x + y = 31 is x on y: x = (31 − y) ÷ 6, so bxy = −1/6.
- Product = (−1.5) × (−1/6) = 0.25, which is not more than 1, so the assumption is valid.
- r² = 0.25, so r = 0.5 in size. Both coefficients are negative, so r = −0.5.
Answer: x̄ = 4, ȳ = 7 and r = −0.5.
Exam tips
- Always find X̄ and Ȳ first. Put them into the options to remove wrong lines quickly.
- When two lines are given, solve them for the means and use the product test (byx × bxy ≤ 1) to decide which is Y on X.
- Read the question for what is known and what is asked. That decides the line, so do not rearrange the other equation.
- Keep numbers exact. Compute the shared numerator once and reuse it for both coefficients.
- If r, σx and σy are given, use byx = r σy ÷ σx directly and skip the table.
Practice questions from Correlation and Regression
- For 25 paired observations of monthly income and expenditure of households in Jaipur, r = 0.6. Using PE = 0.6745 x (1 - r²)/√n, the probable…
- If the coefficient of correlation between X and Y is +0.6, and every X value is replaced by U = 5X − 10 while every Y value is replaced by V…
- For a sample of 6 pairs: Σ(x − x̄)(y − ȳ) = 84, Σ(x − x̄)² = 98 and Σ(y − ȳ)² = 72. Find r. Then, if each y is replaced by 3 − 2y, what is t…
- The coefficient of correlation between the advertising spend and sales of a Pune-based firm is 0.8. What percentage of the variation in sale…
- Data on X and Y give: mean of X = 10, mean of Y = 20, and the regression coefficient of Y on X = 1.5. What is the regression equation of Y o…
Regression Lines and Equations in other exams
The same ground in other exams, if you are preparing for more than one or want another angle on it.
Regression Lines and Equations: frequently asked questions
What is the difference between regression of Y on X and X on Y?
The line of Y on X estimates Y from a known X and minimises squared gaps in the Y direction. The line of X on Y estimates X from a known Y and minimises gaps in the X direction. They are two different lines that meet at the means, and they coincide only when r is +1 or −1.
How do I find the regression line from data?
Find n, ΣX, ΣY, ΣXY and ΣX², then the means and the coefficient byx. Write Y − Ȳ = byx(X − X̄) and simplify. For X on Y, use ΣY² in the denominator of bxy.
What is the least squares method in regression?
It fits the line Y = a + bX so that the sum of squared differences between actual and estimated Y is the smallest possible. You find a and b by solving the two normal equations ΣY = na + bΣX and ΣXY = aΣX + bΣX².
Why is the product of the two regression coefficients never more than 1?
The product byx × bxy equals r², and r lies between −1 and +1. So r² cannot exceed 1. If your two coefficients multiply to more than 1, you have assigned the lines wrongly or made an error.