☰ Year plan · Communication Technology

Data analysis

Week 9 · Chapter 10 Data Analysis: types of data, mean, median, mode, quartiles, variance and standard deviation, scatter plots and correlation, regression · 3 lessons
3

Two variables: scatter plots, correlation and a line of best fit

ICT Secondary 1 Term 1, Chapter 10: pp. 123–141
GoalRead a scatter plot, interpret a correlation coefficient and use a line of best fit inside the range of the data.
New words
scatter plot · a graph where each pair of values is one dotcorrelation coefficient r · a number from −1 to 1 for the straight-line link between two variablescross tabulation · a table that counts two categories togetherregression line · the straight line closest to all the dots
Explanation

A scatter plot shows two variables together, one dot for each pupil. The example has hours of study (1 to 6) and quiz marks: (1, 42), (2, 55), (3, 62), (4, 68), (5, 73), (6, 72). The dots rise from left to right, so the marks tend to rise with the hours. The correlation coefficient r measures how well the dots follow a straight line, from −1 to 1. Near 1: the two rise together. Near −1: one rises as the other falls. Near 0: no straight-line link. For these data r is about 0.94. Correlation is not causation: ice-cream sales and sunburn rise together because both depend on hot weather, not because one causes the other. A cross tabulation counts two categories at once, for instance how many pupils walk or take a bus in each year group. A regression line is the straight line closest to the dots; the least squares method chooses the line with the smallest total of squared gaps between the dots and the line. For these data it is mark = 6 × hours + 41. We may predict inside the range of the data: for 3 hours, 6 × 3 + 41 = 59. We should not predict far outside it: the line says 10 hours gives 101 marks, which is impossible.

hoursmark0123456730405060708090
Worked examples
Pair of variablesTypical rMeaning
hours of study, marks+0.9rise together
sleep lost, alertness−0.9one rises, the other falls
shoe size, quiz mark0no straight-line link
Three pictures of correlation, in words. Hours of study and marks: r near +0.9 (rise together). Hours of sleep lost and alertness: r near −0.9 (one rises as the other falls). Shoe size and quiz mark: r near 0 (no link).
Year AYear BTotal
walk8614
bus7916
total151530
A cross tabulation: 30 pupils by way of travelling and year group. Row and column totals are included: walking 14, bus 16; Year A 15, Year B 15.
Class activity

Using mark = 6 × hours + 41, predict the mark for 2 hours and for 5 hours. Then explain why you would not use the line for 12 hours. Finally invent two variables that rise together but where one does not cause the other.

Practice
1
Using mark = 6 × hours + 41, what is the predicted mark for 4 hours?
2
What does r = −0.8 tell us?
3
Does a high correlation prove that one variable causes the other?
4
Why should we not predict with the line far outside the data?