Prashnikaप्रश्निका
Code
About

Regression lines calculator

Find both regression lines and the correlation coefficient the way ISC Mathematics asks: from the pairs of data (with the deviation table), from summary numbers like Σx and Σxy, or from the two regression lines (which is which, the means and r). Add a value to estimate the other.

How to use it

  1. 1Choose what you have: the data, summary numbers (Σx, Σy, Σxy …) or the two regression lines.
  2. 2Fill in the boxes, and a value to estimate if the question asks for one.
  3. 3Press Solve for both regression lines, b_yx, b_xy and r with the working.
Start from
Worked example

x: 1-5, y: 2, 4, 5, 4, 5

This is the kind of answer you get. Put these values in the boxes or type your own.

Answer

Regression line of y on x
y = ($\dfrac{3}{5}$)x + $\dfrac{11}{5}$
Regression line of x on y
x = y - 1
y when x = 6
$\dfrac{29}{5}$

Values

x̄ (mean of x)
3
ȳ (mean of y)
4
b_yx
$\dfrac{3}{5}$
b_xy
1
r (correlation)
0.7746

Graph

024681234567xy(1, 2)(2, 4)(3, 5)(4, 4)(5, 5)mean (3, 4)estimate (6, 5.8)y on xx on y

Dots are the data; the lines cross at the means (green ring). The dashed line is x on y.

Working

xydx = x - x̄dy = y - ȳdx²dy²dx·dy
12-2-2444
24-10100
3501010
4410100
5521412
Σ 15Σ 20Σ 0Σ 0Σ 10Σ 6Σ 6
  1. n = 5, x̄ = Σx / $n = \dfrac{15}{5}$, ȳ = Σy / $n = \dfrac{20}{5}$
  2. b_yx = Σdx·dy / Σdx² = $\dfrac{6}{10}$
  3. b_xy = Σdx·dy / Σdy² = $\dfrac{6}{6}$
  4. r = Σdx·dy / √(Σdx² · Σdy²), which is also ±√(b_yx · b_xy)

The lines

  1. Regression line of y on x: y - 4 = ($\dfrac{3}{5}$)(x - 3), so y = ($\dfrac{3}{5}$)x + $\dfrac{11}{5}$
  2. Regression line of x on y: x - 3 = 1(y - 4), so x = y - 1

About the Regression lines calculator

What it does

Finds both regression lines and the correlation coefficient the way ISC Mathematics asks: from pairs of data (with the deviation table), from summary numbers such as Σx and Σxy, or from the two regression lines themselves (which is which, the means and r). Add a value to estimate the other variable.

The formulas

  • byx = r σy/σx = (nΣxy − ΣxΣy) / (nΣx² − (Σx)²), the slope of the line of y on x.
  • bxy = r σx/σy = (nΣxy − ΣxΣy) / (nΣy² − (Σy)²).
  • Line of y on x: y − ȳ = byx (x − x̄). Line of x on y: x − x̄ = bxy (y − ȳ).
  • r² = byx × bxy, and r has the same sign as both coefficients.
  • Both lines pass through the point of the means (x̄, ȳ).

Common questions

Which line do I use to estimate y?

The regression line of y on x. To estimate x from a value of y, use the line of x on y.

Can r be bigger than 1?

No. r always lies between −1 and 1. If you get more, check the data or which line is which.

Where do the two regression lines cross?

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

Practise on real ISC questions

More Mathematics tools

All study tools →