#1 India's Top IT Training Institute
×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
Mentors

Mentors

Meet the industry experts who train and guide you through your course.

Read More →
Free Resources

Free Resources

Free tutorials, interview questions, tools and calculators to help you learn.

Explore →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
⚡ FREE · STEP BY STEP

Regression Line Calculator: y on x, x on y and Correlation r

Enter paired x and y values to get both regression lines and r.

  • 📈 Both lines
  • 🔗 r from byx·bxy
  • 📋 Working table

How to use the Regression Line Calculator

  1. 1. Enter x and yType the paired values in the same order.
  2. 2. Add an estimate (optional)Enter an x to estimate y, or a y to estimate x.
  3. 3. Read the linesSee y on x, x on y, byx, bxy, r and the dx, dy table.

The two regression lines

With means x̄ and ȳ and deviations dx = x − x̄, dy = y − ȳ:

y on x: y − ȳ = byx (x − x̄), with byx = Σdxdy / Σdx².
x on y: x − x̄ = bxy (y − ȳ), with bxy = Σdxdy / Σdy².

The correlation coefficient is r = Σdxdy / √(Σdx² Σdy²), and r² = byx × bxy. Both lines pass through (x̄, ȳ). Use y on x to predict y and x on y to predict x; they are different lines unless r = ±1.

Worked example

Take x = 1, 2, 3, 4, 5 and y = 2, 5, 3, 8, 7. Then x̄ = 3 and ȳ = 5. The deviations give Σdx² = 10, Σdy² = 26 and Σdxdy = 13.

byx = 13/10 = 1.3, so y − 5 = 1.3(x − 3), which is y = 1.3x + 1.1. bxy = 13/26 = 0.5, so x − 3 = 0.5(y − 5), which is x = 0.5y + 0.5. Finally r = √(1.3 × 0.5) = √0.65 = 0.8062, a fairly strong positive correlation. At x = 6 the estimate is y = 8.9.

Reading the result

byx and bxy always have the same sign as r, and their product can never exceed 1. If you get a product above 1 in your own working, recheck the sums. Regression shows association, not cause. For a single least-squares line with R² and residuals, use the linear regression calculator; for r alone, try the correlation coefficient calculator.

Frequently asked questions

Why are there two regression lines?

y on x minimises errors in y and x on y minimises errors in x. They coincide only when the correlation is perfect.

How do I find r from the regression coefficients?

r = ±√(byx × bxy), taking the sign of byx and bxy.

Where do the two lines meet?

At the point of means (x̄, ȳ).

Is this calculator free?

Yes. You enter your name and WhatsApp number once when you see your result, and other Uncodemy tools then open without the form.

More free tools

See all free tools