Educerie

Educerie · IB Diploma · Mathematics: analysis and approaches

IB Mathematics AA 4.1 · SL and HL

Populations, samples and sampling

Before you calculate anything from a set of data, how do you decide whether the data deserve to be trusted?

What you will learn

  • Know what a population, a sample and a random sample are, and tell discrete from continuous data
  • Understand how sampling methods and data sources lead to bias, and why a bigger sample does not cure it
  • Know how to handle missing values and recording errors, and how to report what was done
  • Know the 1.5 × IQR outlier rule and understand when an outlier is genuine and when it is an error

You must be able to

  1. Determine whether a value is an outlier, showing both fences and the comparison
  2. Calculate how many to take from each group in a stratified sample
  3. Identify a sampling technique from a description and describe how to carry one out
  4. Explain why a sample may be biased, naming the group missed and the effect on the result
  5. State whether data are discrete or continuous, with a reason
  6. Decide whether an outlier or recorded value should be kept, corrected or removed, in context

In the exam. Paper 1 and Paper 2, almost always as the opening parts of a longer statistics question: classify the data (1 mark), name or describe a sampling technique (1 to 2 marks), work out the numbers in a stratified sample (2 to 3 marks), test a value for being an outlier (3 to 4 marks) and say whether it should stay (1 to 2 marks). The outlier test with given quartiles is Paper 1 arithmetic; with raw data it is usually Paper 2, with the quartiles from your GDC. The same ideas decide whether the data in your exploration are fit to use.

1Population, sample and census

  • The population = the whole collection of people or things the question is about.
    • The question fixes it, not your convenience.
    • Example: a bakery chain wants to know how long customers queue. The population is every customer of the chain, not the lunchtime crowd at one shop.
    • Write it as who, where, when.
  • A census = measuring every member. It is rarely sensible: it can cost too much or take too long.
    • Some tests wreck what they measure. A car maker that crash-tested every car would have none left to sell.
  • So we take a sample = a subset of the population, used to estimate the same quantity for the whole population. Figure 1 shows the trade.
Figure 1 · A sample stands in for the population Population: every student in the school Sample: chosen at random select Statistic from the sample mean sleep 7.1 hours a night estimate for the population Measure the sample, then use what you find to estimate the same quantity for the population.
Figure 1 · A sample stands in for the population
  • A random sample = members picked by a chance process, so every member of the population is equally likely to be picked.
    • Randomness matters because human choice lets taste leak in.
    • Example: a teacher told to "pick a few typical pupils" reaches for the ones she remembers, and they are not typical.
    • A random sample can still be unlucky. It promises only that any mismatch is chance, not a built-in lean. The chance mismatch tends to shrink as the sample grows.
  • Sampling error = the chance gap between what the sample shows and the truth for the whole population.
  • Non-sampling error = a human mistake, such as mis-typing a value. It can happen in a census too.
  • To pick at random from a list, you need a sampling frame = a list holding every member of the population once.
    • Number the list. Let a random number generator choose numbers, discarding repeats. A frame that leaves people out is a first source of bias (section 4).
  • Exam convention: at SL, the data set in a question is the population unless the question says otherwise.
    • This matters in 4.3. Your GDC offers two standard deviations, and you must choose the right one.

2Discrete and continuous data

  • Discrete data = separate, particular values, usually because they are counted: goals in a match, books on a shelf, tickets sold.
    • Shoe sizes (66, 6126\tfrac{1}{2}, 77) are discrete too, although not whole numbers. Nothing exists between size 66 and size 6126\tfrac{1}{2}.
  • Continuous data = measured, and can take any value in a range: time, mass, length, temperature.
    • What you record is rounded to the precision of the instrument.
    • Example: a time written as 13.47 s13.47\ \mathrm{s} really means "somewhere from 13.465 s13.465\ \mathrm{s} up to 13.475 s13.475\ \mathrm{s}". Figure 2 sets the two side by side.
Figure 2 · Discrete values are separate; continuous values fill a range 0 1 2 3 4 5 6 Discrete: number of siblings only these values are possible; 2.4 siblings is not 11 12 13 14 15 16 17 Continuous: time to run 100 m (seconds) 13.47 s, recorded to the nearest 0.01 s Between two continuous values there is always another. Between two discrete values there may be none.
Figure 2 · Discrete values are separate; continuous values fill a range
  • Decide by the quantity, not by how the numbers look. The test: between any two possible values, is another always possible? If so, the data are continuous.
    • Decimals, still discrete. A price in dollars and cents.
    • Whole numbers, still continuous. A height rounded to the nearest centimetre.
  • Two cases need a sentence of judgement:
    • Age. It is continuous (you are older every second), but "age in completed years" behaves like counted data.
    • Money. It moves in cents and is strictly discrete. Large sums such as company profits are usually treated as continuous.
  • If a question hinges on it, say which you are assuming and why.
  • In an answer, give the reason: "continuous, because it is measured", "discrete, because it is counted". The choice decides how data are shown later: continuous data go into class intervals such as 20≤t<2520 \le t < 25 with no gaps (4.2).

3Five ways to choose a sample

Invented setting: the Harbour Library has 600 registered members: 240 children, 270 adults and 90 retired members. The librarian wants the views of 40 of them on later opening hours.

  • Convenience sampling = ask whoever is easiest to reach.
    • Example: the first 40 members in on Saturday morning.
    • It is quick and nearly free, and the weakest method. People who are easy to reach share habits. The unusual members are not at hand.
  • Simple random sampling = number the members 1 to 600 and let a random number generator choose 40 different numbers. Every possible group of 40 is equally likely.
    • It needs a complete list. An unlucky draw can miss a small group such as the retired members.

Systematic sampling = take every kkth member of an ordered list, from a random start. Here

k=population sizesample size k = \frac{\text{population size}}{\text{sample size}}

k=60040=15intervalk = \frac{600}{40} = 15 \qquad \textcolor{#838c91}{\text{interval}}random start between 1 and 15, say 8\text{random start between 1 and 15, say 8}members 8,23,38,…,5938+39×15=593, the 40th member\text{members } 8, 23, 38, \dots, 593 \qquad \textcolor{#838c91}{8 + 39 \times 15 = 593\text{, the 40th member}}
  • A stated fraction gives the interval by its reciprocal: a 4% sample takes every 25th. If the division is not exact, round kk and accept a sample size close to the target.
  • Fast and even. It spreads the sample through the list.
  • No full list needed. It works when members turn up one at a time, such as cars passing a toll gate.
  • Its weak point is a list that repeats in a cycle.
    • Example: names come in pages of 15, each headed by a committee member. A start of 1 picks only committee members.
  • Only the start is random, so it is not a simple random sample. Members 8 and 9 can never both be chosen.
  • Stratified sampling = split the population into strata, then take a random sample from each stratum, in proportion to its size.
    • Strata are non-overlapping groups that might answer differently. Here they are the three member types.
children: 240600×40=16\text{children: } \frac{240}{600} \times 40 = 16adults: 270600×40=18\text{adults: } \frac{270}{600} \times 40 = 18retired: 90600×40=6\text{retired: } \frac{90}{600} \times 40 = 6check: 16+18+6=40\text{check: } 16 + 18 + 6 = 40
  • Inside each stratum the members are picked at random. The general line is (stratum size ÷\div population size) ×\times sample size.
  • When the answers are not whole numbers, round, then check the total.
    • Example: a call centre with 350 day staff and 230 night staff, sampled at 30, gives 18.118.1 and 11.911.9. That is 1818 and 1212, total 3030.
    • If rounding leaves the total one short or one over, adjust the stratum whose decimal part was nearest to a half, and say so.
  • Stratifying works best when members of a stratum resemble each other and the strata differ from each other. Every group appears in its true share, so it:
    • usually gives a smaller sampling error than a simple random sample of the same size.
    • lets you compare the groups.
  • Its price is information. You must know each member's group and each group's size.
  • Quota sampling = the collector is told how many to find in each group (16 children, 18 adults, 6 retired members). Each quota is filled with whoever is available.
    • It looks like stratified sampling. The difference is the whole point. Within each group the people are not chosen at random.
    • Example: the adults in the library at ten on a Tuesday morning are not typical adults.
    • It is quick and needs no list. But the collector's choices let bias in.

Figures 3 and 4 show all five methods on one group of 40, with 10 chosen.

Figure 3 · Three random methods, 10 chosen from 40 Simple random any 10 equally likely Systematic every 4th, random start at 3 3 7 11 15 19 23 27 31 35 39 Stratified 6 children and 4 adults, each at random Teal: 24 children. Amber: 16 adults. Ringed: chosen. Chance does the choosing in all three.
Figure 3 · Three random methods, 10 chosen from 40
Figure 4 · Two non-random methods Quota 6 children, 4 adults, first found Convenience the 10 nearest the door door Quota fixes how many from each group but lets the collector pick. Convenience takes the nearest.
Figure 4 · Two non-random methods

4Judging a method, and bias

A method is effective = likely to give a sample that represents the population, at a cost you can bear.

MethodChosen by chance?Needs a full list?Groups in true proportion?Main risk
Simple randomyesyesonly on averagea small group missed by bad luck
Systematiconly the startan ordered list or a streamonly on averagea cycle in the list
Stratifiedyes, within stratayes, with each member's groupyesneeds detailed information; more work
Quotanonoyes, by designthe collector's choices
Conveniencenononopeople who are easy to reach are not typical

When a question says "comment on" a method or asks for an improvement, give three things:

  • the flaw.
  • the direction it could push the result.
  • a random method that would remove it.
  • Bias = a systematic lean of the sample away from the population in one direction.
    • It is not bad luck, so a bigger sample does not cure it. A biased method used on 10,000 people gives a very precise wrong answer.
  • Size does matter for chance error. Five households, however chosen, are too few to speak for a town: one unusual household moves the result a long way.

The usual sources of bias:

  • Selection bias. The frame leaves groups out. An email-only survey cannot reach people with no email.
  • Non-response bias. Those who reply differ from those who do not. Long forms are filled in mostly by people with time, or strong feelings.
  • Self-selection. Volunteers choose themselves, so a phone-in poll hears from people with a strong view.
  • Response bias. The wording or setting steers the answer. "Don't you agree the car park fees are far too high?" invites yes. People overstate how often they exercise.
  • The guide points to real cases worth looking up, each a sample that did not represent its population:
    • the Literary Digest and George Gallup polls for the 1936 US presidential election.
    • Google's flu predictor.
    • Boston's pot-hole app.
    • the Kinsey reports.
  • Example (invented): before a mayoral election in the made-up town of Varnholm, the Varnholm Courier prints a voting coupon. It gets 40,000 back, 68% for candidate P.
    • A polling firm asks 800 voters picked at random from the electoral roll. It finds candidate Q ahead, and Q wins.
    • The coupons came from readers who chose to reply. The paper's readers were older and better off than the town. So 40,000 replies gave a very precise wrong answer: plenty of data, still not representative.

A source is reliable = its figures can be trusted to describe what they claim, and a repeat of the collection would give similar results. Figure 5 lists questions to put to any data set, in an exam or a newspaper.

Figure 5 · Six questions to ask before you trust a data set 1 Who collected it, and why? a reason to want one answer? 2 What is the population? who are the results about? 3 How was the sample chosen? random, or whoever was easy? 4 How big, and who replied? size and non-response 5 How was it measured or asked? instrument, units, wording 6 What is missing or odd? gaps, impossible values, outliers If any answer is "we do not know", say so, and say how it could bias the result.
Figure 5 · Six questions to ask before you trust a data set

5Missing data and errors in recording

Real data have gaps and slips. Two rules cover almost everything.

A missing value is left out, never written as 0. An impossible or clearly mistyped value is corrected from the original record if you can, removed if you cannot, and you say what you did.

  • Example: a botany student measures the heights of ten seedlings, in cm: 14.2,15.8,13.9,16.1,0,15.0,145,14.7,15.4,13.614.2, 15.8, 13.9, 16.1, 0, 15.0, 145, 14.7, 15.4, 13.6.
    • The 00 belongs to a pot where nothing germinated, so there is nothing to measure.
    • The 145145 is impossible for a seedling. The lab book shows 14.514.5, so the decimal point was missed.
mean as recorded=263.710=26.37 cmdragged up by 145, down by 0\text{mean as recorded} = \frac{263.7}{10} = 26.37\ \mathrm{cm} \qquad \textcolor{#838c91}{\text{dragged up by }145\text{, down by }0}drop the 0, correct 145→14.5: 133.29=14.8 cmn=9, not 10\text{drop the } 0\text{, correct } 145 \to 14.5\text{: } \frac{133.2}{9} = 14.8\ \mathrm{cm} \qquad \textcolor{#838c91}{n = 9\text{, not }10}
  • The raw mean of 26.4 cm26.4\ \mathrm{cm} describes no seedling in the tray. The cleaned mean is honest if you say that nn fell from 10 to 9, and why.
  • Never repair a value by guessing. Had the lab book been lost, remove the 145145; do not invent 14.514.5.
  • A few gaps in a large data set do little harm. When many values are missing, the members behind them may differ from the rest (the non-response problem again), and the conclusion is shaky.

6Outliers: the rule, then the judgement

  • An outlier = a data item more than 1.5×IQR1.5 \times \mathrm{IQR} from the nearest quartile.
  • The interquartile range IQR=Q3−Q1\mathrm{IQR} = Q_{3} - Q_{1} is the width of the middle half of the data.

xx is an outlier if x<Q1−1.5×IQRx < Q_{1} - 1.5 \times \mathrm{IQR} or x>Q3+1.5×IQRx > Q_{3} + 1.5 \times \mathrm{IQR}.

The two limits are the fences. Everything between them is ordinary. A value exactly on a fence is not an outlier: the rule says more than.

Worked example (raw data, invented): fifteen employees of a small firm record their commuting times in minutes:

12,14,15,17,18,19,20,21,22,22,24,25,27,30,58 12, 14, 15, 17, 18, 19, 20, 21, 22, 22, 24, 25, 27, 30, 58

  • With n=15n = 15 the median is the 8th value, 2121.
  • Q1Q_{1} is the median of the seven values below it, Q3Q_{3} of the seven above. Most GDCs use this method.
Q1=17,Q3=254th and 12th valuesQ_{1} = 17, \quad Q_{3} = 25 \qquad \textcolor{#838c91}{\text{4th and 12th values}}IQR=25−17=8\mathrm{IQR} = 25 - 17 = 81.5×IQR=121.5 \times \mathrm{IQR} = 12lower fence=17−12=5\text{lower fence} = 17 - 12 = 5upper fence=25+12=37\text{upper fence} = 25 + 12 = 3758>37, so 58 is an outlier; 12>5, so nothing is an outlier at the low end58 > 37\text{, so } 58 \text{ is an outlier; } 12 > 5\text{, so nothing is an outlier at the low end}

Figure 6 draws the fences. They are measured from the quartiles, not from the median.

Figure 6 · The outlier fences for the commuting times 0 5 10 15 20 25 30 35 40 45 50 55 60 65 Commuting time (minutes) lower fence 5 upper fence 37 Q₁ = 17 Q₃ = 25 1.5 × IQR = 12 12 58 > 37: outlier IQR = 25 − 17 = 8. The fences sit 1.5 × 8 = 12 beyond each quartile, at 5 and 37. Only 58 lies outside.
Figure 6 · The outlier fences for the commuting times
  • Judgement: the rule says a value is unusual, not what to do.
    • A valid outlier is a genuine member of the population. The 58-minute commuter probably lives in the next town. Deleting that person would make the firm's commutes look shorter than they are, so keep the value and mention it.
    • An error cannot be true, or has an obvious recording explanation: 580 minutes, a height of 17.2 m17.2\ \mathrm{m}, a mass typed in grams among kilograms. Correct it from the source, or remove it and say so.
  • When the question says "justify", write the comparison with the fence, then the sentence about context.
  • Working backwards: the exam sometimes gives the IQR, says there are no outliers, and asks for a least or greatest possible quartile. Write the fence as an inequality and solve it.
    • Example: if IQR=6\mathrm{IQR} = 6 and the largest value is 4141, no outlier means 41≤Q3+941 \le Q_{3} + 9, so Q3≥32Q_{3} \ge 32.
    • The largest value that is not an outlier is the fence itself. With Q3=10Q_{3} = 10 and IQR=4\mathrm{IQR} = 4 it is 1616, not 1515. At the low end: x≥Q1−1.5×IQRx \ge Q_{1} - 1.5 \times \mathrm{IQR}.
  • Why it matters: outliers drag some summaries more than others. With the 5858, the commuting mean is 22.922.9 minutes. Without it, 20.420.4. The median moves only from 2121 to 20.520.5.
    • You use this in 4.3 when choosing which average to quote. In 4.2, a box-and-whisker diagram marks each outlier with a cross.

In exam words: a Paper 1 version gives Q1=17Q_{1} = 17 and Q3=25Q_{3} = 25 and asks:

  • (a) Show that 58 is an outlier. 2 marks
  • (b) Interpret the effect of this value on the mean. 1 mark
1.5×IQR=1.5×8=12,Q3+12=25+12=37M1: the upper fence, from Q31.5 \times \mathrm{IQR} = 1.5 \times 8 = 12, \quad Q_{3} + 12 = 25 + 12 = 37 \qquad \textcolor{#838c91}{\text{M1: the upper fence, from }Q_{3}}58>37, so 58 is an outlierR1: the comparison, written out58 > 37 \text{, so } 58 \text{ is an outlier} \qquad \textcolor{#838c91}{\text{R1: the comparison, written out}}
  • (b) The 58 pulls the mean up, from 20.420.4 to 22.922.9 minutes. The median hardly moves. So the mean overstates a typical commute, and the median describes it better.
  • In a "show that" the conclusion is printed. The marks are for the fence and the written comparison, so give both.

7Putting it together: one question, start to finish

Exam stems stack these skills. A museum has 1,200 on its mailing list: 840 regular visitors and 360 students. It wants a sample of 48.

  1. Systematic: k=1200÷48=25k = 1200 \div 48 = 25. Use a random start between 1 and 25, say 9. Then take every 25th name: 9,34,59,…9, 34, 59, \dots, the last being 9+47×25=11849 + 47 \times 25 = 1184. Say the start is random and the step is fixed.
  2. Stratified by group: 8401200×48=33.6\dfrac{840}{1200} \times 48 = 33.6 and 3601200×48=14.4\dfrac{360}{1200} \times 48 = 14.4, so 3434 and 1414. Check: 34+14=4834 + 14 = 48.
  3. Comment: the systematic sample does not guarantee that students appear in their true share. A stratified sample does, provided the museum knows each person's group.
  4. If the replies show a visit time of 9 hours, test it against the fences. Then ask whether a visitor could really stay 9 hours, or whether the answer was typed in minutes.

Practice questions

26 questions on this note, from easy to hard. Each one you get right lights a star of this topic's constellation.