4.1 · SLPaper 1Paper 2

Sampling, data quality and outliers

30 min read

In a minute

Statistics is only as good as its data. You learn how a stands in for a , how the way it is chosen can bias it, and how to handle missing or wrongly recorded values. You also find an with the 1.5×IQR1.5 \times \mathrm{IQR} rule and decide whether to keep it.

You'll be able to

  • Use the words population, sample and , and tell from .
  • Judge a data source, and say where , missing values and recording errors come from.
  • Find outliers with the 1.5×IQR1.5 \times \mathrm{IQR} rule and decide whether each is a real value or an error.
  • Describe simple random, systematic, stratified, quota and , and judge how well each represents the population.
  • Find the interval for a systematic sample and the group sizes for a stratified sample.
Before you start3 quick questions on what this builds on
Check yourself
Find the mean of 1212, 1515, 99, 2020 and 1414.
Check yourself
Write down the median of 44, 66, 99, 1313, 1515 and 1818.
Check yourself
A youth orchestra has 640640 applicants, and 35%35\% of them play a string instrument. How many is that?

Populations, samples and types of data

A city wants the average commute time of its 45 00045\,000 office workers. Timing all of them is not practical. Timing 300300 well-chosen workers gives a good estimate.

Rounding doesn't change the type. A wait recorded as 1414 minutes is still continuous. A dress size is discrete: it jumps from 1010 to 1212.

Worked exampleA hospital ward records, for each patient: (a) the number of visitors on Sunday; (b) body temperature in °C; (c) the number of nights on the ward; (d) the time spent waiting in the emergency department. Classify each as discrete or continuous.

Try it first, then reveal one step at a time.

  1. Ask of each one: is it counted or measured?
Worked exampleA recycling depot receives 36003600 bags in a week. An inspector opens a random sample of 9090 bags, and 2727 contain items that can't be recycled. (a) State the population and the sample. (b) Estimate how many of the week's bags contain such items, and interpret your answer.

Try it first, then reveal one step at a time.

  1. (a) The population is all 36003600 bags that week. The sample is the 9090 bags opened.
Check yourself
Which of these is discrete data?
Check yourself
A shop sold 54005400 phones last year. The buyers of a random sample of 120120 of these phones are contacted, and 4242 report a cracked screen. Estimate the number of cracked screens among all 54005400 phones.

Reliable data and sampling bias

Before you trust a data set, ask: who collected it, and do they gain from a particular result? How were the members chosen? Are any values missing or impossible?

Common causes: part of the population can't be reached, volunteers choose themselves, and people who don't reply may differ from those who do. A bigger sample chosen the same way is just as biased.

Missing data: never record a blank as 00. Leave it out and say how many values are missing. A genuine 00 is real data and stays.

Recording errors: a slipped decimal point, a wrong unit or a typing slip. Look for impossible values. Correct one only if you know the true value; otherwise remove it and say so.

Worked exampleA school records how many minutes each of its 99 buses arrives late one morning. Two drivers forgot to log a time: 44, 00, 77, 1212, missing, 33, 99, missing, 55. (a) Find the mean lateness of the recorded buses, to 3 s.f. (b) Explain why entering each missing value as 00 gives a misleading mean.

Try it first, then reveal one step at a time.

  1. (a) Leave out the two missing values. The 00 is real (that bus was on time), so it stays.
Worked exampleA streaming service plans a price rise. It emails a survey to all 80 00080\,000 subscribers, and 16001600 reply. Of these, 70%70\% say they would cancel. (a) Assuming the replies represent all subscribers, estimate how many would cancel. (b) Explain why this estimate is likely to be too high.

Try it first, then reveal one step at a time.

  1. (a) Apply 70%70\% to all subscribers: 0.7×80000=560000.7 \times 80000 = 56000.
Check yourself
An energy drink brand's website says its drink improves exam results, citing a study of 200200 students. It doesn't say how they were chosen. Why should you doubt this source?
Check yourself
A sleep tracker shows these hours for six nights: 7.27.2, 6.86.8, 00, 8.18.1, 7.57.5, 6.96.9. The 00 is a night when it wasn't worn. Find the mean of the real readings, to 3 s.f.

Outliers

Some values sit far from the rest. To decide which count as unusual, everyone uses one rule, built from the .

In ordered data, about a quarter of the values lie below the lower quartile Q1Q_{1}, and about three quarters below the upper quartile Q3Q_{3}. Read them from your GDC's one-variable statistics.

The , IQR=Q3−Q1\mathrm{IQR} = Q_{3} - Q_{1}, is the spread of the middle half of the data. It is in the formula booklet.

Learn this rule: it is not in the booklet. The two boundaries are the lower and upper fences. The inequalities are strict, so a value exactly on a fence is not an outlier.

Number line with a box from Q1 to Q3 and the median inside it. One and a half IQRs are measured out from Q1 down to the lower fence and from Q3 up to the upper fence. Values beyond either fence are outliers. 1.5 × IQR IQR 1.5 × IQR Q1 Q3 median lower fence upper fence outliers outliers
Measure 1.5×IQR1.5 \times \mathrm{IQR} out from the nearer quartile, never from the median.
Worked exampleFor the daily screen times of a class, Q1=2.4Q_{1} = 2.4 hours and Q3=4.6Q_{3} = 4.6 hours. Two students report 8.18.1 hours and 0.20.2 hours. Decide whether each is an outlier, and comment on whether 8.18.1 hours should be kept.

Try it first, then reveal one step at a time.

  1. IQR=4.6−2.4=2.2\mathrm{IQR} = 4.6 - 2.4 = 2.2, so 1.5×IQR=3.31.5 \times \mathrm{IQR} = 3.3 hours.

The rule only flags a value; it doesn't make it wrong. A value that is possible in context is valid: keep it. An impossible value or clear slip is an error: correct it if you know the true value, or remove it and say so.

Worked exampleThe times, in seconds, of 1212 swimmers in a 5050 m school race are 31.231.2, 33.533.5, 29.829.8, 35.135.1, 32.432.4, 30.630.6, 34.234.2, 3.273.27, 31.931.9, 33.033.0, 28.728.7, 47.547.5. (a) Use your calculator to find Q1Q_{1} and Q3Q_{3}. (b) Hence identify any outliers, and comment on whether each is valid. (c) The timing sheet has been lost. Find the mean time of the swims you keep, to 3 s.f.

Try it first, then reveal one step at a time.

  1. (a) Run one-variable statistics on the 1212 times and write down Q1=30.2Q_{1} = 30.2 and Q3=33.85Q_{3} = 33.85.
Check yourself
For the number of books read last year by the members of a reading club, Q1=12Q_{1} = 12 and Q3=20Q_{3} = 20. Is a member who read 3232 books an outlier?
Check yourself
The daily step counts of 3030 office workers have Q1=5200Q_{1} = 5200 and Q3=8800Q_{3} = 8800. Two recorded values are 19 50019\,500 and −300-300. Which statement is correct?

Sampling methods

Effectiveness: free of sampling bias, but it needs a full list, and by chance it can miss a small group.

Effectiveness: quickest and cheapest, but the most likely to be biased.

Effectiveness: quick and evenly spread, but biased if the list has a pattern that repeats every kk members.

Effectiveness: quick and needs no list, but not random, so the collector's choices can bias it.

Learn this
number from a stratum=size of stratumsize of population×sample size\text{number from a stratum} = \frac{\text{size of stratum}}{\text{size of population}} \times \text{sample size}

Effectiveness: usually the most representative, but it needs each stratum's size and a list of its members.

Worked exampleName the sampling method. (a) A reporter asks the first 2525 people leaving a concert. (b) An inspector picks one of the first 5050 bottles off a production line at random, then tests every 5050th bottle after it. (c) A researcher interviews people of her choice in a park until she has 2020 under 3030 and 2020 aged 3030 or over. (d) A computer picks 1212 numbers at random from a full list of 180180 students.

Try it first, then reveal one step at a time.

  1. (a) The easiest people to reach: convenience sampling.
Worked exampleA ferry carries 960960 passengers, listed by ticket number from 11 to 960960. The company surveys a systematic sample of 4040. (a) Find the sampling interval kk and describe how to choose the sample. (b) The random start is ticket 99. Show that ticket 393393 is chosen, and find mm, its position in the sample.

Try it first, then reveal one step at a time.

  1. (a) k=96040=24k = \frac{960}{40} = 24. Pick a whole number from 11 to 2424 at random as the first ticket, then take every 2424th ticket after it.
Worked exampleA university has 920920 first-year students: 209209 in Science, 407407 in Arts and 304304 in Business. A stratified sample of 4646 is chosen. Find SS, AA and BB, the numbers from Science, Arts and Business, and say why this method suits the survey.

Try it first, then reveal one step at a time.

  1. Shares: Science 209920×46=10.45\frac{209}{920} \times 46 = 10.45, Arts 407920×46=20.35\frac{407}{920} \times 46 = 20.35, Business 304920×46=15.2\frac{304}{920} \times 46 = 15.2.
Check yourself
A factory tests the first 3030 batteries made each morning. Which sampling method is this?
Check yourself
A town has 64006400 residents, of whom 17601760 are under 1818. A stratified sample of 200200 is chosen by age group. How many under-1818s are in the sample?
Check yourself
Which statement about quota sampling is true?

Common mistakes

  • Measuring the fences from the median. Start from Q1Q_{1} for the lower fence and Q3Q_{3} for the upper one.
  • Calling a value on a fence an outlier. The inequalities are strict.
  • Deleting an outlier just because it is one. Remove or correct only an impossible value or a known error.
  • Giving a bias reason about the survey, not the sampling method. Say who the method leaves out or favours.
  • Calling the first to arrive, or everyone who turns up one day, a systematic sample. That is convenience sampling.
  • Recording a missing value as 00. Leave it out and divide by the number of real values.

Exam tips

  • State or write down a sampling method: the name is enough. Describe one: say how members are chosen; for systematic, give kk and a random start in the first kk.
  • Explain why a sample may be biased: tie the reason to the method and the context, such as who could never be chosen.
  • Verify that a value is an outlier: write the fence with numbers in, then compare using << or >>.
  • Comment on an outlier: say whether it is possible in context, then whether to keep it.

Key takeaways

Learn thisPopulation: the whole group a question is about. Sample: the part you collect data from. Counted data is discrete; measured data is continuous, even when rounded.
Learn thisSampling bias comes from how a sample is chosen; a bigger sample chosen the same way doesn't remove it.
Learn thisLeave a missing value out and say how many are missing; never record it as 00. Correct a recording error only if you know the true value; otherwise remove it and say so.
In bookletIQR=Q3−Q1\mathrm{IQR} = Q_{3} - Q_{1} (in the formula booklet).
Learn thisoutlier: x<Q1−1.5×IQRorx>Q3+1.5×IQR\text{outlier: } x < Q_{1} - 1.5 \times \mathrm{IQR} \quad \text{or} \quad x > Q_{3} + 1.5 \times \mathrm{IQR}
Learn thisA value exactly on a fence is not an outlier. Keep an outlier that is possible in context; correct or remove only an error.
Learn thisSimple random: every sample of that size equally likely. Systematic: every kkth of an ordered list, k=Nnk = \frac{N}{n} (rounded down if not whole), random start in the first kk, stop at nn (if nn doesn't divide NN, the end of the list is never chosen). Stratified: random within groups, in proportion. Quota: fixed numbers per group, collector chooses. Convenience: easiest to reach.
Learn thisnumber from a stratum=size of stratumsize of population×sample size\text{number from a stratum} = \frac{\text{size of stratum}}{\text{size of population}} \times \text{sample size}

Practise this

10 past-paper questions on Sampling and data collection in the AI HL bank, each with a mark scheme and a worked explanation.

Also: Outliers and data interpretation (8)

Practise Sampling and data collection →