M
Math Coach Amy
Amy Ferguson Moncure

IB AA · 6D Correlation and Regression

Regression Line of y on x

Find the gradient from the deviations, then write the line through the mean point.

Jump to section:

y − ȳ = a(x − x̄)

What to Remember

Gradient

a = sum of (x − x̄)(y − ȳ)sum of (x − x̄)²

Through the mean

y − ȳ = a(x − x̄). The line passes through the mean point.

Then expand

Multiply out and simplify to y = ax + b.

The mean of y

If the line and the mean of x are known, substitute the mean of x. The result is the mean of y.

Easy

Easy

The points lie on the line. The gradient is an integer.

Example
Tickets sold, x, and programmes printed, y.
xy
10
22
34
58
610
712
Find the equation of the regression line of y on x.

Mean of x = sum of the valuesnumber of values

Sum = 1 + 2 + 3 + 5 + 6 + 7

Sum = 24

There are 6 values.

Mean of x = 246

Mean of x = 4

Mean of y = sum of the valuesnumber of values

Sum = 0 + 2 + 4 + 8 + 10 + 12

Sum = 36

There are 6 values.

Mean of y = 366

Mean of y = 6

The mean point is (4, 6).

xyx − x̄y − ȳ(x − x̄)(y − ȳ)(x − x̄)²
10−3−6189
22−2−484
34−1−221
581221
6102484
71236189

Sum of (x − x̄)(y − ȳ) = 18 + 8 + 2 + 2 + 8 + 18

Sum of (x − x̄)(y − ȳ) = 56

Sum of (x − x̄)² = 9 + 4 + 1 + 1 + 4 + 9

Sum of (x − x̄)² = 28

a = sum of (x − x̄)(y − ȳ)sum of (x − x̄)²

a = 5628

a = 2

y − 6 = 2(x − 4)

y − 6 = 2x − 8

y = 2x − 8 + 6

y = 2x − 2

Check: at x = 4, y = 6. The line passes through the mean point.

Answer: y = 2x − 2

1
Hours parked, x, and dollars on the meter, y.
xy
324
423
522
720
819
918
Find the equation of the regression line of y on x.
Show Answer

Mean of x = sum of the valuesnumber of values

Sum = 3 + 4 + 5 + 7 + 8 + 9

Sum = 36

There are 6 values.

Mean of x = 366

Mean of x = 6

Mean of y = sum of the valuesnumber of values

Sum = 24 + 23 + 22 + 20 + 19 + 18

Sum = 126

There are 6 values.

Mean of y = 1266

Mean of y = 21

The mean point is (6, 21).

xyx − x̄y − ȳ(x − x̄)(y − ȳ)(x − x̄)²
324−33−99
423−22−44
522−11−11
7201−1−11
8192−2−44
9183−3−99

Sum of (x − x̄)(y − ȳ) = −9 − 4 − 1 − 1 − 4 − 9

Sum of (x − x̄)(y − ȳ) = −28

Sum of (x − x̄)² = 9 + 4 + 1 + 1 + 4 + 9

Sum of (x − x̄)² = 28

a = sum of (x − x̄)(y − ȳ)sum of (x − x̄)²

a = −2828

a = −1

y − 21 = −(x − 6)

y − 21 = −x + 6

y = −x + 6 + 21

y = −x + 27

Check: at x = 6, y = 21. The line passes through the mean point.

Answer: y = −x + 27

2
Classes attended, x, and worksheets finished, y.
xy
23
36
49
512
615
718
821
Find the equation of the regression line of y on x.
Show Answer

Mean of x = sum of the valuesnumber of values

Sum = 2 + 3 + 4 + 5 + 6 + 7 + 8

Sum = 35

There are 7 values.

Mean of x = 357

Mean of x = 5

Mean of y = sum of the valuesnumber of values

Sum = 3 + 6 + 9 + 12 + 15 + 18 + 21

Sum = 84

There are 7 values.

Mean of y = 847

Mean of y = 12

The mean point is (5, 12).

xyx − x̄y − ȳ(x − x̄)(y − ȳ)(x − x̄)²
23−3−9279
36−2−6124
49−1−331
5120000
6151331
71826124
82139279

Sum of (x − x̄)(y − ȳ) = 27 + 12 + 3 + 0 + 3 + 12 + 27

Sum of (x − x̄)(y − ȳ) = 84

Sum of (x − x̄)² = 9 + 4 + 1 + 0 + 1 + 4 + 9

Sum of (x − x̄)² = 28

a = sum of (x − x̄)(y − ȳ)sum of (x − x̄)²

a = 8428

a = 3

y − 12 = 3(x − 5)

y − 12 = 3x − 15

y = 3x − 15 + 12

y = 3x − 3

Check: at x = 5, y = 12. The line passes through the mean point.

Answer: y = 3x − 3

3
Age of a battery, in months, x, and hours it lasts, y.
xy
628
726
824
824
922
1020
Find the equation of the regression line of y on x.
Show Answer

Mean of x = sum of the valuesnumber of values

Sum = 6 + 7 + 8 + 8 + 9 + 10

Sum = 48

There are 6 values.

Mean of x = 486

Mean of x = 8

Mean of y = sum of the valuesnumber of values

Sum = 28 + 26 + 24 + 24 + 22 + 20

Sum = 144

There are 6 values.

Mean of y = 1446

Mean of y = 24

The mean point is (8, 24).

xyx − x̄y − ȳ(x − x̄)(y − ȳ)(x − x̄)²
628−24−84
726−12−21
8240000
8240000
9221−2−21
10202−4−84

Sum of (x − x̄)(y − ȳ) = −8 − 2 + 0 + 0 − 2 − 8

Sum of (x − x̄)(y − ȳ) = −20

Sum of (x − x̄)² = 4 + 1 + 0 + 0 + 1 + 4

Sum of (x − x̄)² = 10

a = sum of (x − x̄)(y − ȳ)sum of (x − x̄)²

a = −2010

a = −2

y − 24 = −2(x − 8)

y − 24 = −2x + 16

y = −2x + 16 + 24

y = −2x + 40

Check: at x = 8, y = 24. The line passes through the mean point.

Answer: y = −2x + 40

4
Rows planted, x, and boxes filled, y.
xy
06
17
28
39
410
511
612
Find the equation of the regression line of y on x.
Show Answer

Mean of x = sum of the valuesnumber of values

Sum = 0 + 1 + 2 + 3 + 4 + 5 + 6

Sum = 21

There are 7 values.

Mean of x = 217

Mean of x = 3

Mean of y = sum of the valuesnumber of values

Sum = 6 + 7 + 8 + 9 + 10 + 11 + 12

Sum = 63

There are 7 values.

Mean of y = 637

Mean of y = 9

The mean point is (3, 9).

xyx − x̄y − ȳ(x − x̄)(y − ȳ)(x − x̄)²
06−3−399
17−2−244
28−1−111
390000
4101111
5112244
6123399

Sum of (x − x̄)(y − ȳ) = 9 + 4 + 1 + 0 + 1 + 4 + 9

Sum of (x − x̄)(y − ȳ) = 28

Sum of (x − x̄)² = 9 + 4 + 1 + 0 + 1 + 4 + 9

Sum of (x − x̄)² = 28

a = sum of (x − x̄)(y − ȳ)sum of (x − x̄)²

a = 2828

a = 1

y − 9 = (x − 3)

y − 9 = x − 3

y = x − 3 + 9

y = x + 6

Check: at x = 3, y = 9. The line passes through the mean point.

Answer: y = x + 6

5
Shows watched, x, and reviews written, y.
xy
74
86
98
1010
1010
1112
1214
1316
Find the equation of the regression line of y on x.
Show Answer

Mean of x = sum of the valuesnumber of values

Sum = 7 + 8 + 9 + 10 + 10 + 11 + 12 + 13

Sum = 80

There are 8 values.

Mean of x = 808

Mean of x = 10

Mean of y = sum of the valuesnumber of values

Sum = 4 + 6 + 8 + 10 + 10 + 12 + 14 + 16

Sum = 80

There are 8 values.

Mean of y = 808

Mean of y = 10

The mean point is (10, 10).

xyx − x̄y − ȳ(x − x̄)(y − ȳ)(x − x̄)²
74−3−6189
86−2−484
98−1−221
10100000
10100000
11121221
12142484
131636189

Sum of (x − x̄)(y − ȳ) = 18 + 8 + 2 + 0 + 0 + 2 + 8 + 18

Sum of (x − x̄)(y − ȳ) = 56

Sum of (x − x̄)² = 9 + 4 + 1 + 0 + 0 + 1 + 4 + 9

Sum of (x − x̄)² = 28

a = sum of (x − x̄)(y − ȳ)sum of (x − x̄)²

a = 5628

a = 2

y − 10 = 2(x − 10)

y − 10 = 2x − 20

y = 2x − 20 + 10

y = 2x − 10

Check: at x = 10, y = 10. The line passes through the mean point.

Answer: y = 2x − 10

Medium

Medium

The gradient is a fraction.

Example
Warm-up minutes, x, and sit-ups completed, y.
xy
46
58
67
69
78
810
Find the equation of the regression line of y on x.

Mean of x = sum of the valuesnumber of values

Sum = 4 + 5 + 6 + 6 + 7 + 8

Sum = 36

There are 6 values.

Mean of x = 366

Mean of x = 6

Mean of y = sum of the valuesnumber of values

Sum = 6 + 8 + 7 + 9 + 8 + 10

Sum = 48

There are 6 values.

Mean of y = 486

Mean of y = 8

The mean point is (6, 8).

xyx − x̄y − ȳ(x − x̄)(y − ȳ)(x − x̄)²
46−2−244
58−1001
670−100
690100
781001
8102244

Sum of (x − x̄)(y − ȳ) = 4 + 0 + 0 + 0 + 0 + 4

Sum of (x − x̄)(y − ȳ) = 8

Sum of (x − x̄)² = 4 + 1 + 0 + 0 + 1 + 4

Sum of (x − x̄)² = 10

a = sum of (x − x̄)(y − ȳ)sum of (x − x̄)²

a = 810

a = 45

y − 8 = 45(x − 6)

y − 8 = 45x − 245

y = 45x − 245 + 8

y = 45x − 245 + 405

y = 45x + 165

Check: at x = 6, y = 8. The line passes through the mean point.

Answer: y = 45x + 165

1
Weeks in storage, x, and charge remaining, y.
xy
716
814
915
913
1014
1112
Find the equation of the regression line of y on x.
Show Answer

Mean of x = sum of the valuesnumber of values

Sum = 7 + 8 + 9 + 9 + 10 + 11

Sum = 54

There are 6 values.

Mean of x = 546

Mean of x = 9

Mean of y = sum of the valuesnumber of values

Sum = 16 + 14 + 15 + 13 + 14 + 12

Sum = 84

There are 6 values.

Mean of y = 846

Mean of y = 14

The mean point is (9, 14).

xyx − x̄y − ȳ(x − x̄)(y − ȳ)(x − x̄)²
716−22−44
814−1001
9150100
9130−100
10141001
11122−2−44

Sum of (x − x̄)(y − ȳ) = −4 + 0 + 0 + 0 + 0 − 4

Sum of (x − x̄)(y − ȳ) = −8

Sum of (x − x̄)² = 4 + 1 + 0 + 0 + 1 + 4

Sum of (x − x̄)² = 10

a = sum of (x − x̄)(y − ȳ)sum of (x − x̄)²

a = −810

a = −45

y − 14 = −45(x − 9)

y − 14 = −45x + 365

y = −45x + 365 + 14

y = −45x + 365 + 705

y = −45x + 1065

Check: at x = 9, y = 14. The line passes through the mean point.

Answer: y = −45x + 1065

2
Chapters read, x, and examples tried, y.
xy
37
49
511
58
69
710
Find the equation of the regression line of y on x.
Show Answer

Mean of x = sum of the valuesnumber of values

Sum = 3 + 4 + 5 + 5 + 6 + 7

Sum = 30

There are 6 values.

Mean of x = 306

Mean of x = 5

Mean of y = sum of the valuesnumber of values

Sum = 7 + 9 + 11 + 8 + 9 + 10

Sum = 54

There are 6 values.

Mean of y = 546

Mean of y = 9

The mean point is (5, 9).

xyx − x̄y − ȳ(x − x̄)(y − ȳ)(x − x̄)²
37−2−244
49−1001
5110200
580−100
691001
7102124

Sum of (x − x̄)(y − ȳ) = 4 + 0 + 0 + 0 + 0 + 2

Sum of (x − x̄)(y − ȳ) = 6

Sum of (x − x̄)² = 4 + 1 + 0 + 0 + 1 + 4

Sum of (x − x̄)² = 10

a = sum of (x − x̄)(y − ȳ)sum of (x − x̄)²

a = 610

a = 35

y − 9 = 35(x − 5)

y − 9 = 35x − 3

y = 35x − 3 + 9

y = 35x + 6

Check: at x = 5, y = 9. The line passes through the mean point.

Answer: y = 35x + 6

3
Days off, x, and routines remembered, y.
xy
99
107
115
118
127
136
Find the equation of the regression line of y on x.
Show Answer

Mean of x = sum of the valuesnumber of values

Sum = 9 + 10 + 11 + 11 + 12 + 13

Sum = 66

There are 6 values.

Mean of x = 666

Mean of x = 11

Mean of y = sum of the valuesnumber of values

Sum = 9 + 7 + 5 + 8 + 7 + 6

Sum = 42

There are 6 values.

Mean of y = 426

Mean of y = 7

The mean point is (11, 7).

xyx − x̄y − ȳ(x − x̄)(y − ȳ)(x − x̄)²
99−22−44
107−1001
1150−200
1180100
1271001
1362−1−24

Sum of (x − x̄)(y − ȳ) = −4 + 0 + 0 + 0 + 0 − 2

Sum of (x − x̄)(y − ȳ) = −6

Sum of (x − x̄)² = 4 + 1 + 0 + 0 + 1 + 4

Sum of (x − x̄)² = 10

a = sum of (x − x̄)(y − ȳ)sum of (x − x̄)²

a = −610

a = −35

y − 7 = −35(x − 11)

y − 7 = −35x + 335

y = −35x + 335 + 7

y = −35x + 335 + 355

y = −35x + 685

Check: at x = 11, y = 7. The line passes through the mean point.

Answer: y = −35x + 685

4
Plots watered, x, and blooms counted, y.
xy
08
110
29
211
310
412
Find the equation of the regression line of y on x.
Show Answer

Mean of x = sum of the valuesnumber of values

Sum = 0 + 1 + 2 + 2 + 3 + 4

Sum = 12

There are 6 values.

Mean of x = 126

Mean of x = 2

Mean of y = sum of the valuesnumber of values

Sum = 8 + 10 + 9 + 11 + 10 + 12

Sum = 60

There are 6 values.

Mean of y = 606

Mean of y = 10

The mean point is (2, 10).

xyx − x̄y − ȳ(x − x̄)(y − ȳ)(x − x̄)²
08−2−244
110−1001
290−100
2110100
3101001
4122244

Sum of (x − x̄)(y − ȳ) = 4 + 0 + 0 + 0 + 0 + 4

Sum of (x − x̄)(y − ȳ) = 8

Sum of (x − x̄)² = 4 + 1 + 0 + 0 + 1 + 4

Sum of (x − x̄)² = 10

a = sum of (x − x̄)(y − ȳ)sum of (x − x̄)²

a = 810

a = 45

y − 10 = 45(x − 2)

y − 10 = 45x − 85

y = 45x − 85 + 10

y = 45x − 85 + 505

y = 45x + 425

Check: at x = 2, y = 10. The line passes through the mean point.

Answer: y = 45x + 425

5
Terms in the club, x, and events still attended, y.
xy
615
713
814
812
913
1011
Find the equation of the regression line of y on x.
Show Answer

Mean of x = sum of the valuesnumber of values

Sum = 6 + 7 + 8 + 8 + 9 + 10

Sum = 48

There are 6 values.

Mean of x = 486

Mean of x = 8

Mean of y = sum of the valuesnumber of values

Sum = 15 + 13 + 14 + 12 + 13 + 11

Sum = 78

There are 6 values.

Mean of y = 786

Mean of y = 13

The mean point is (8, 13).

xyx − x̄y − ȳ(x − x̄)(y − ȳ)(x − x̄)²
615−22−44
713−1001
8140100
8120−100
9131001
10112−2−44

Sum of (x − x̄)(y − ȳ) = −4 + 0 + 0 + 0 + 0 − 4

Sum of (x − x̄)(y − ȳ) = −8

Sum of (x − x̄)² = 4 + 1 + 0 + 0 + 1 + 4

Sum of (x − x̄)² = 10

a = sum of (x − x̄)(y − ȳ)sum of (x − x̄)²

a = −810

a = −45

y − 13 = −45(x − 8)

y − 13 = −45x + 325

y = −45x + 325 + 13

y = −45x + 325 + 655

y = −45x + 975

Check: at x = 8, y = 13. The line passes through the mean point.

Answer: y = −45x + 975

Hard

Hard

The sums are given, or the line is given and the mean of y is missing.

Example
For a data set, the mean of x is 6 and the mean of y is 11. The sum of (x − x̄)(y − ȳ) is 18, and the sum of (x − x̄)² is 12. Find the equation of the regression line of y on x.

a = sum of (x − x̄)(y − ȳ)sum of (x − x̄)²

a = 1812

a = 32

y − 11 = 32(x − 6)

y − 11 = 32x − 9

y = 32x − 9 + 11

y = 32x + 2

Answer: y = 32x + 2

1
For a data set, the mean of x is 5 and the mean of y is 9. The sum of (x − x̄)(y − ȳ) is 24, and the sum of (x − x̄)² is 8. Find the equation of the regression line of y on x.
Show Answer

a = sum of (x − x̄)(y − ȳ)sum of (x − x̄)²

a = 248

a = 3

y − 9 = 3(x − 5)

y − 9 = 3x − 15

y = 3x − 15 + 9

y = 3x − 6

Answer: y = 3x − 6

2
For a data set, the mean of x is 4 and the mean of y is 16. The sum of (x − x̄)(y − ȳ) is −20, and the sum of (x − x̄)² is 10. Find the equation of the regression line of y on x.
Show Answer

a = sum of (x − x̄)(y − ȳ)sum of (x − x̄)²

a = −2010

a = −2

y − 16 = −2(x − 4)

y − 16 = −2x + 8

y = −2x + 8 + 16

y = −2x + 24

Answer: y = −2x + 24

3
For a data set, the mean of x is 8 and the mean of y is 7. The sum of (x − x̄)(y − ȳ) is 15, and the sum of (x − x̄)² is 20. Find the equation of the regression line of y on x.
Show Answer

a = sum of (x − x̄)(y − ȳ)sum of (x − x̄)²

a = 1520

a = 34

y − 7 = 34(x − 8)

y − 7 = 34x − 6

y = 34x − 6 + 7

y = 34x + 1

Answer: y = 34x + 1

4
A coach recorded laps and bottles of water. The regression line of y on x is y = 4x − 7. The mean of x is 5. Find the mean of y.
Show Answer

The regression line passes through the mean point.

Mean of y = 4(5) − 7

Mean of y = 20 − 7

Mean of y = 13

Answer: Mean of y = 13.

5
A gardener recorded weeks and new leaves. The regression line of y on x is y = 12x + 6. The mean of x is 8. Find the mean of y.
Show Answer

The regression line passes through the mean point.

Mean of y = 12(8) + 6

Mean of y = 4 + 6

Mean of y = 10

Answer: Mean of y = 10.

Want to go over a scatter diagram together?

Book a Session with Amy