๐Ÿ”— Correlation and Outliers

A Level Maths Year 1 ยท Statistics

Level 3 · Ages 16–17

← Back to topic overview
1 Scatter Diagrams and Correlation

Bivariate data are pairs of values $(x, y)$ measured on the same items โ€” the height and mass of each student, or the temperature and ice-cream sales on each day. A scatter diagram shows whether the two variables are related.

PatternDescriptionInterpretation
Points close to a line sloping upwardsStrong positive correlationAs $x$ increases, $y$ tends to increase
Points loosely around a line sloping downwardsWeak negative correlationAs $x$ increases, $y$ tends to decrease, but not reliably
No patternNo (or zero) correlationNo linear relationship between the variables
Correlation describes how close the points are to a straight line. At AS you interpret it informally โ€” "strong", "weak", "positive", "negative". (The product moment correlation coefficient, $r$, measures it on a scale from $-1$ to $1$; testing it is in Year 2.) Correlation only measures linear association: points lying on a clear curve can have weak correlation.
Explanatory and response variables
The explanatory (independent) variable $x$ is the one that is controlled or that may influence the other; it goes on the horizontal axis.
The response (dependent) variable $y$ goes on the vertical axis.
Worked Example 1 โ€” Describing a scatter diagram

The diagram shows the hours of revision $x$ and test score $y$ (%) for $12$ students, with the regression line of $y$ on $x$. Describe the relationship.

0246810 Hours of revision, x 204060 Score (%), y y = 12.7 + 4.16x
โ‘ The points lie close to an upward-sloping line: strong positive correlation.
โ‘กIn context: students who revised for longer tended to score higher.
2 Regression Lines
The regression line of $y$ on $x$, $y = a + bx$, is the line of best fit calculated to make the vertical distances of the points from the line as small as possible (least squares). At AS you will be given its equation and asked to interpret and use it โ€” calculating it is not required.
PartMeaningIn Worked Example 1
Gradient $b$The change in $y$ for each increase of $1$ in $x$Each extra hour of revision is associated with about $4.16$ more marks
Intercept $a$The value of $y$ when $x = 0$A student who did no revision would score about $12.7\%$
Interpret the intercept with care. If $x = 0$ lies outside the range of the data (here the students revised between $2$ and $10$ hours), the intercept is an extrapolation and may have no sensible meaning.
Interpolation and extrapolation
Interpolation: predicting within the range of the data โ€” usually reliable if correlation is strong
Extrapolation: predicting outside the range of the data โ€” unreliable, because the relationship may not continue
Worked Example 2 โ€” Using a regression line

Use $y = 12.7 + 4.16x$ to estimate the score of a student who revised for (a) $6$ hours, (b) $25$ hours. Comment on the reliability of each.

โ‘ (a) $y = 12.7 + 4.16(6) = 37.66 \approx 37.7\%$.
โ‘ก$6$ hours is within the data range $2$โ€“$10$ (interpolation) and the correlation is strong, so this is reliable.
โ‘ข(b) $y = 12.7 + 4.16(25) = 116.7\%$ โ€” impossible.
โ‘ฃ$25$ hours is far outside the data (extrapolation); the linear relationship clearly cannot continue, as scores cannot exceed $100\%$.
Use $y$ on $x$ to predict $y$. The regression line of $y$ on $x$ is designed to predict $y$ from a given $x$. It should not in general be rearranged to predict $x$ from $y$.
3 Correlation Is Not Causation
A correlation shows that two variables tend to change together. It does not show that a change in one causes the change in the other. Both may be driven by a third (confounding) variable, or the link may be coincidence.
Worked Example 3 โ€” A third variable

Over a year, the monthly number of ice creams sold at a beach and the monthly number of sunburn cases at a clinic show strong positive correlation. A newspaper claims ice cream causes sunburn. Comment.

โ‘ Both variables increase in hot, sunny months.
โ‘กThe weather (temperature / hours of sunshine) is a likely third variable causing both.
โ‘ขCorrelation does not imply causation, so the claim is not justified by these data.
Worked Example 4 โ€” Distinct sections of a population

The diagram shows height $x$ cm and mass $y$ kg for $10$ children (circles) and $10$ adults (squares). Comment on the correlation.

110130150170190 Height, x (cm) 30507090 Mass, y (kg) childrenadults
โ‘ Taken all together, the points suggest strong positive correlation.
โ‘กBut the data fall into two distinct groups. Within each group the correlation is weak.
โ‘ขThe apparent strong correlation is mostly due to the difference between the groups. A single regression line through all $20$ points would be misleading; it would be better to analyse the groups separately.
4 Outliers
An outlier is a value that is unusually far from the rest of the data. There is no single definition; the question will tell you which rule to use. The two most common are:
Rule 1 โ€” based on quartiles
Outlier if below $Q_1 - 1.5 \times \text{IQR}$ or above $Q_3 + 1.5 \times \text{IQR}$
Rule 2 โ€” based on the mean and standard deviation
Outlier if more than $2$ (or $3$) standard deviations from the mean: outside $\bar{x} \pm 2\sigma$ (or $\bar{x} \pm 3\sigma$)
Worked Example 5 โ€” The quartile rule

A data set has $Q_1 = 24$ and $Q_3 = 36$. Its smallest value is $3$ and its largest is $58$. Are either of these outliers?

โ‘ IQR $= 12$, and $1.5 \times 12 = 18$.
โ‘กFences: $24 - 18 = 6$ and $36 + 18 = 54$.
โ‘ข$3 < 6$ and $58 > 54$, so both are outliers.
Worked Example 6 โ€” The standard deviation rule

A data set has mean $50$ and standard deviation $6$. Decide whether $65$ and $39$ are outliers using (a) $\bar{x} \pm 2\sigma$, (b) $\bar{x} \pm 3\sigma$.

โ‘ (a) Limits $50 \pm 12$: $38$ to $62$. $65$ is an outlier; $39$ is not.
โ‘ก(b) Limits $50 \pm 18$: $32$ to $68$. Neither is an outlier.
The choice of rule matters โ€” always use the one stated in the question, and quote the limits you calculated.
What to do with an outlier. First ask why it is there. If it is an error (a recording mistake, an impossible value, wrong units), correct it or remove it. If it is a genuine but unusual value, it is real information and should normally be kept โ€” though you might report results with and without it, or use the median and IQR, which it does not distort.
5 Cleaning Data and the Large Data Set

Real data sets are messy. Cleaning means checking the data before analysing them and dealing with:

Worked Example 7 โ€” Cleaning a small data set

A survey of sixth-form students records height (cm): $172,\; 165,\; 1.68,\; 181,\; \text{n/a},\; 159,\; 1680,\; 176$. Clean the data and find the mean height.

โ‘ $1.68$ is almost certainly in metres: convert to $168$ cm.
โ‘ก$1680$ is impossible; it is probably $168.0$ with a misplaced decimal point. Either correct it (if this can be checked) or remove it. Here we remove it.
โ‘ข"n/a" is missing: exclude it.
โ‘ฃCleaned data: $172, 165, 168, 181, 159, 176$; $n = 6$, $\sum x = 1021$, mean $= 170.2$ cm (1 d.p.).
Including $1.68$ and $1680$ unchanged would have given a mean of $\dfrac{2534.68}{7} = 362.1$ cm โ€” absurd. Always look at your data before calculating.
Your board's large data set. Each exam board publishes a large data set of real data (for example on weather, transport or health) for you to explore with a spreadsheet during the course. Questions may assume you know its context โ€” what the variables mean, typical values and units, and how missing values are coded โ€” and may ask you to clean, sample or interpret it. Spend time with your own board's data set; it can help you recognise when a value or a conclusion is unrealistic.
6 Quick Reference

Correlation

Strength and direction of a linear relationship.

Axes

Explanatory $x$ horizontal; response $y$ vertical.

Gradient $b$

Change in $y$ per unit increase in $x$.

Intercept $a$

$y$ when $x = 0$ โ€” beware if outside the data.

Interpolation

Within the data range โ€” reliable.

Extrapolation

Outside the data range โ€” unreliable.

Causation

Correlation alone never proves it.

Outlier rules

$Q_1 - 1.5\,$IQR, $Q_3 + 1.5\,$IQR; or $\bar{x} \pm 2\sigma$ / $3\sigma$.

Cleaning

Missing, errors, units, outliers.

7 Practice Questions
Question 1

State the type of correlation you would expect between (a) the age of a car and its value; (b) shoe size and score in a maths test, for adults; (c) height and arm span.

โ–ถ Show solution

(a) Negative โ€” older cars tend to be worth less.

(b) None โ€” no reason for a relationship.

(c) Positive โ€” taller people tend to have longer arm spans.

Question 2

For temperatures $x\,^\circ$C between $8$ and $28$, a cafรฉ finds the regression line of daily cold-drink sales $y$ on $x$ is $y = 14 + 6.5x$. (a) Interpret $6.5$. (b) Estimate sales when $x = 20$. (c) Comment on using the line when $x = 40$.

โ–ถ Show solution

(a) For each $1\,^\circ$C rise in temperature, about $6.5$ more cold drinks are sold per day.

(b) $14 + 6.5(20) = 144$ drinks.

(c) $40\,^\circ$C is outside the range of the data ($8$ to $28$), so this would be extrapolation and the prediction ($274$) would be unreliable.

Question 3

Data for many towns show strong positive correlation between the number of doctors and the number of deaths each year. Someone concludes that doctors cause deaths. Explain the flaw.

โ–ถ Show solution

Correlation does not imply causation. Larger towns have both more doctors and more deaths simply because they have more people: population size is a confounding variable.

Question 4

A data set has $Q_1 = 15$ and $Q_3 = 27$. Using the $1.5 \times \text{IQR}$ rule, decide whether the values $2$ and $47$ are outliers.

โ–ถ Show solution

IQR $= 12$, $1.5 \times 12 = 18$. Fences: $15 - 18 = -3$ and $27 + 18 = 45$.

$2 > -3$, so $2$ is not an outlier. $47 > 45$, so $47$ is an outlier.

Question 5

The heights of a group of adults have mean $170$ cm and standard deviation $8$ cm. An outlier is defined as more than $3$ standard deviations from the mean. Are $150$ cm and $198$ cm outliers?

โ–ถ Show solution

Limits: $170 \pm 24$, i.e. $146$ to $194$.

$150$ is within the limits โ€” not an outlier. $198 > 194$ โ€” an outlier.

Question 6

For $10$ values, $\sum x = 250$ and $\sum x^2 = 6390$. The largest value is $33$. Is it an outlier using the rule "more than $2$ standard deviations from the mean"?

โ–ถ Show solution

$\bar{x} = 25$; $\sigma^2 = 639 - 625 = 14$, so $\sigma = 3.742$.

Upper limit: $25 + 2(3.742) = 32.48$.

$33 > 32.48$, so $33$ is an outlier (only just).

Question 7

Daily rainfall (mm) at a weather station for a week is recorded as $3.2,\; 0,\; -1.5,\; 12.4,\; \text{(blank)},\; 0.8,\; 124$. Identify the problems and suggest how to deal with each.

โ–ถ Show solution

$-1.5$: rainfall cannot be negative โ€” an error; remove it (or check the original record).

Blank: a missing value โ€” exclude it from calculations and note this.

$124$: far larger than the rest โ€” possibly $12.4$ entered wrongly, or a genuine extreme storm. Check the source before deciding; do not simply delete a value that could be real.

Question 8

A scientist records the amount of fertiliser $x$ g given to plants and their final height $y$ cm. (a) Which is the explanatory variable? (b) Explain why the scientist should be wary of predicting the height for a fertiliser amount twice as large as any used in the experiment.

โ–ถ Show solution

(a) The amount of fertiliser $x$, which the scientist controls.

(b) This is extrapolation. The linear relationship may not continue โ€” for example, too much fertiliser could damage the plants.

Question 9

The values $4, 5, 6, 6, 7, 8, 30$ are recorded. Find the mean and standard deviation (a) with and (b) without the value $30$. Comment.

โ–ถ Show solution

(a) $\sum x = 66$, $\sum x^2 = 1126$, $n = 7$: $\bar{x} = 9.43$, $\sigma^2 = \tfrac{1126}{7} - 9.43^2 = 71.96$, $\sigma = 8.48$.

(b) $\sum x = 36$, $\sum x^2 = 226$, $n = 6$: $\bar{x} = 6$, $\sigma^2 = \tfrac{226}{6} - 36 = 1.667$, $\sigma = 1.29$.

The single value $30$ raises the mean by over $3$ and multiplies the standard deviation by more than $6$. The mean and standard deviation are very sensitive to outliers.

Question 10

For $30$ summer days at a seaside kiosk, the daily maximum temperature $x\,^\circ$C ranged from $12$ to $26$. The regression line of ice creams sold, $y$, on $x$ is $y = -45 + 9.2x$.

(a) Interpret the gradient.   (b) Estimate the sales on a day with maximum temperature $20\,^\circ$C.   (c) Use the line to estimate sales at $2\,^\circ$C, and explain why the answer is not sensible.   (d) On one day with $x = 24$, only $12$ ice creams were sold. Compare this with the line, suggest a possible reason, and say whether the point should be removed.   (e) The owner says "hot weather causes people to buy ice creams". Do the data prove this?

โ–ถ Show solution

(a) Each $1\,^\circ$C increase in maximum temperature is associated with about $9.2$ more ice creams sold.

(b) $-45 + 9.2(20) = 139$ ice creams.

(c) $-45 + 9.2(2) = -26.6$: negative sales are impossible. $2\,^\circ$C is far outside the data range, so this is extrapolation.

(d) The line predicts $-45 + 9.2(24) = 175.8$, so $12$ is far below โ€” a likely outlier. Perhaps the kiosk closed early, or there was heavy rain despite the warmth. If it is a genuine but unusual day, it should not simply be deleted; if it was caused by something unrelated to temperature (such as the kiosk being shut), there is a case for excluding it, with an explanation.

(e) No. The data show a strong association, and the claim is plausible, but correlation alone does not prove causation. Other factors that rise with temperature โ€” school holidays, numbers of tourists, weekends โ€” could also explain the sales.

Correlation and Outliers · A Level Maths Year 1 · Created with MathJax