This is the corrected exercise set on descriptive statistics for Advanced Statistics, 201-337, at CEGEP. It is also one of the most directly useful chapters of the course, because descriptive statistics are the tool you meet again in social science, business administration, health science and in any critical reading of the news. The set of ten corrected exercises, preceded by a list of calculations, covers types of variables and sampling methods, the mean, the median and the mode, the variance and the standard deviation, the coefficient of variation, z-scores, quartiles, the box plot and outliers, the weighted mean, data grouped into classes, the ogive and percentiles, and linear transformations of data.
Exercise 0.1 opens the set with ten measures to compute directly on small data sets with no context, as in textbook drill lists: the mean, the median of an odd unsorted data set and of an even one, the mode, the mean of a frequency table, the range and the interquartile range, the sample variance and standard deviation with division by n−1, the population standard deviation and the coefficient of variation, each with a value to find and checked as you type it.
Exercise 2 sets out the central point of the chapter: among the eight salaries of a small business, the mean is 62,500 dollars while seven employees out of eight earn less. It is not a wrong calculation, it is a badly chosen measure, and knowing which one to choose is exactly what the chapter teaches.
By the end, you can classify a variable and spot the bias of a sample, which size never corrects (exercise 1), explain why we divide by n−1 (exercise 3), compare two marks from different groups through their z-scores (exercise 4), declare an outlier with the 1.5 times the interquartile range rule (exercise 5), avoid the mean of means when the groups do not have the same size (exercise 6), compute on classes through their midpoints (exercise 7), read a decile on an ogive by interpolation (exercise 8), and predict the effect of a change of units on the mean, the standard deviation and the z-score (exercise 9). Exercise 10 puts it all to work in a critical reading of the incomes of a neighbourhood.
Self-checking setType your answers and check them question by question: the page tells you right or wrong before you open the solution. With an account, every answer right on the first try earns points, and your right answers stay filled in when you come back.
•Mean x=n∑xi: sensitive to extreme values. Median: the middle value once the data are sorted, insensitive to extremes. Mode: the most frequent value.
•In a symmetric distribution, the mean and the median coincide. If the mean is GREATER than the median, the distribution is skewed to the right, which is the case for incomes.
•Range =xmax−xmin. Variance of a SAMPLE s2=n−1∑(xi−x)2; of a POPULATION σ2=n∑(xi−μ)2. The standard deviation is the square root of the variance.
•We divide by n−1 for a sample because the mean has already been estimated from the same data: only n−1 independent deviations remain. Without this correction, the spread would be systematically underestimated.
•z-score: z=sx−x. It expresses a deviation as a NUMBER OF STANDARD DEVIATIONS and makes it possible to compare values that come from different distributions.
•Quartiles: Q1, Q2 (the median) and Q3 split the data into four equal parts. Interquartile range IQR=Q3−Q1.
•Outlier: any data value outside the interval [Q1−1.5IQR,Q3+1.5IQR].
•Coefficient of variation CV=xs×100: RELATIVE spread, with no unit, the only way to compare the spread of two data sets on different scales.
•Types of variables: qualitative NOMINAL (no order), qualitative ORDINAL (ordered, but with no measurable gaps), quantitative DISCRETE (you count), quantitative CONTINUOUS (you measure). A postal code stays nominal despite its digits. A PARAMETER describes the population, a STATISTIC describes the sample.
•The size of a sample only reduces RANDOM error. A selection bias, a coverage bias or a nonresponse bias is never corrected by surveying more people.
•Weighted mean: x=∑wi∑wixi. The mean of means is correct only if the subgroups have the SAME size; otherwise you must weight by the group sizes.
•Ogive: cumulative frequencies plotted against the UPPER BOUNDARY of each class. A percentile is read by linear interpolation within its class, which assumes the data are spread uniformly inside it.
•Transformation y=ax+b: y=ax+b, sy=∣a∣sx, variance multiplied by a2. The z-score, for its part, is INVARIANT if a>0. The coefficient of variation only makes sense on a scale with an absolute zero.
Calculations: the measures of a data set
Exercise 0.1: Computing the measures of a data set: ten direct calculations
For each line, compute the requested measure on the given data set, with no context and no interpretation. Give the exact value when it comes out evenly, otherwise round to the nearest hundredth. The quartiles follow the convention of the course: Q1 and Q3 are the medians of the lower half and of the upper half of the sorted data.
Always three moves. SORT the data before any median or quartile. COUNT n before dividing: in a frequency table, n is the sum of the frequencies. For the spread, compute the mean, then the deviations xi−x, their squares and their sum, and divide by n−1 for a sample, by n for a population, before taking the square root.
a) 14, 9, 21, 17, 12: compute the mean x.
b) 31, 18, 44, 27, 39, 22, 35: compute the median.
c) 6, 11, 3, 9, 14, 8: compute the median.
d) 4, 7, 7, 2, 9, 7, 4, 5: give the mode.
e) Values xi: 0, 1, 2, 3, 4, with frequencies ni: 5, 8, 4, 2, 1 respectively. Compute the mean x.
f) 12, 5, 24, 8, 3, 17, 9, 15, 6, 11: compute the range, then the interquartile range IQR=Q3−Q1.
h) Sample 21, 25, 18, 30, 26, 24: compute the standard deviation s.
i) The data set of h) treated as a POPULATION: compute the standard deviation σ.
j) x=48.5 and s=7.3: compute the coefficient of variation, as a percentage.
Show the solution
Answers
a)x=573=14.6
b)Median =31
c)Median =28+9=8.5
d)Mode =7
e)x=2026=1.3
f)Range =21; Q1=6, Q3=15, IQR=9
g)s2=430=7.5
h)s=586≈4.15
i)σ=686≈3.79
j)CV=48.57.3×100≈15.05%
The move that decides everything comes before the calculation: sort the data and count n. A median taken on unsorted data, or the mean of a table divided by the number of VALUES instead of the number of DATA POINTS, is wrong however careful the rest is.
a)
x=514+9+21+17+12=573=14.6.
b)
Sorted data: 18, 22, 27, 31, 35, 39, 44. With n=7, the median is the 4th value: 31. Pitfall: taking the middle value of the UNSORTED list, 27.
c)
Sorted data: 3, 6, 8, 9, 11, 14. With n=6 even, the median is the mean of the 3rd and 4th values: 28+9=8.5. Pitfall: taking 23+9=6, the two central values of the unsorted list.
d)
The value 7 appears three times, the value 4 twice, the others once: the mode is 7. The mode is a VALUE, not its frequency 3.
e)
n=5+8+4+2+1=20 and ∑nixi=0×5+1×8+2×4+3×2+4×1=0+8+8+6+4=26, so x=2026=1.3. Pitfall: dividing by 5, the number of distinct values, which gives 5.2.
x=540=8. Deviations −4, −1, 0, 2, 3, with squares 16, 1, 0, 4, 9, whose sum is 30. A sample, so s2=5−130=7.5. Pitfall: dividing by n=5, which gives 6, the population variance.
h)
x=6144=24. Deviations −3, 1, −6, 6, 2, 0, with squares 9, 1, 36, 36, 4, 0, whose sum is 86. So s2=586=17.2 and s=17.2≈4.15. Pitfall: stopping at the variance 17.2.
i)
Same sum of squares, divided this time by n=6: σ2=686≈14.33 and σ≈3.79. The population standard deviation is always the smaller of the two, since we divide by a larger number.
j)
CV=xs×100=48.57.3×100≈15.05%. Pitfall: dividing the mean by the standard deviation, 7.348.5.
Check: the sum of the deviations xi−x is always 0, which validates the mean before squaring (−4−1+0+2+3=0 in g), −3+1−6+6+2+0=0 in h)). A median or a quartile always falls between the minimum and the maximum, and s is always larger than σ on the same data, as soon as the values are not all equal.
Tick the exercises you have done or want to review: a free account, no password, keeps your ticks and your right answers from one visit to the next, tells you which chapter to tackle next and lets you ask for the exercise you are missing. Create your space, an email is enough.
Part A: Variables, central tendency and dispersion (/50)
Exercise 1: Variables, population and sampling methods
Before any calculation, you need to know what is being measured and on whom. The type of variable determines which statistics make sense, and the way the sample is built determines whether the results are worth anything at all.
A CEGEP has 4,200 students. We want to estimate the mean commuting time between home and the college from a sample of 300 students.
a) Classify each of the following variables: eye colour, level of satisfaction on a scale from 1 to 5, number of siblings, commuting time in minutes, postal code. State for each one whether it is qualitative nominal, qualitative ordinal, quantitative discrete or quantitative continuous.
b) Identify the population, the statistical unit, the variable studied and the sample. What is the difference between a PARAMETER and a STATISTIC, and which of the two are we looking for here?
c) Describe how to build the sample by simple random sampling, then by systematic sampling, giving the sampling interval. If 60% of the students are enrolled in science, how many would a proportional stratified sample contain?
d) Three surveys are proposed: an online poll announced on the college web page and filled in by whoever wants to; a questionnaire handed out at the library exit one Tuesday at 4 p.m.; an email sent to all 4,200 students, of whom 300 reply. Identify the dominant bias of each one.
e) In 1936, an American magazine surveys 2.4 million people and predicts Roosevelt's defeat; a polling institute surveys 50,000 and predicts his victory, which was a landslide. Explain how a sample 48 times smaller can beat a giant sample.
b)Population: the 4,200 students. Unit: one student. Variable: the commuting time. Sample: 300 students. We look for the PARAMETER μ, we only have the statistic x.
c)Systematic interval k=14. Proportional stratified: 180 in science and 120 outside science.
d)Self-selection; coverage; nonresponse, with a response rate of 7.1%.
e)Size only reduces random error. The magazine had a biased sampling frame: 48 times more replies, all shifted the same way.
a)
Eye colour: qualitative NOMINAL, the categories have no order. Level of satisfaction from 1 to 5: qualitative ORDINAL, the categories are ordered but the gaps are not measurable; nothing says that going from 1 to 2 is the same as going from 4 to 5. Number of siblings: quantitative DISCRETE, you count, and in-between values do not exist. Commuting time: quantitative CONTINUOUS, any value in an interval is possible, only the precision of the instrument limits it. Postal code: qualitative NOMINAL, despite its digits: computing the mean of postal codes would make no sense, and that is the decisive test.
b)
Population: the 4,200 students of the CEGEP. Statistical unit: one student. Variable: the commuting time from home to the college, in minutes. Sample: the 300 students surveyed. A PARAMETER is a characteristic of the POPULATION, here the mean time μ of the 4,200, a single value, fixed and unknown. A STATISTIC is the same characteristic computed on the SAMPLE, here x, which changes from one sample to the next. We are looking for the parameter, and all we have is the statistic: the rest of the course is about measuring the gap between the two.
c)
SIMPLE random sampling: number the 4,200 students, then draw 300 numbers at random, each student having the same probability and every group of 300 being equally possible. SYSTEMATIC: the sampling interval is k=3004200=14; draw one student at random among the first 14, then take every 14th student on the list. Proportional STRATIFIED: the science stratum is 60% of the population, so it must be 60% of the sample too, that is (0.60)(300)=180 science students and 120 students outside science.
d)
Online poll open to whoever wants to answer: SELF-SELECTION bias, the most motivated answer, typically those with a long commute or a grievance. Questionnaire at the library exit one Tuesday at 4 p.m.: COVERAGE bias, the sampling frame is not the population; it reaches neither evening students nor those who go home early because they live far away, precisely the ones the study is about. Email with 300 replies out of 4,200: NONRESPONSE bias, with a response rate of 7% there is no reason to believe that the respondents resemble the 3,900 who stayed silent. In all three cases, increasing the size corrects nothing: the flaw is not in the number, it is in the way people are chosen.
e)
Because size NEVER makes up for a selection bias. The magazine had drawn its addresses from telephone directories and car registration lists: in the middle of the Great Depression, owning a telephone or a car was the privilege of a well-off minority, rather hostile to Roosevelt. Every new reply therefore added to a sample that was systematically off target, without ever correcting the shift. The institute, on the other hand, had built a sample representative of the social structure of the country. The lesson is fundamental: the size of the sample only reduces RANDOM error, the one that comes from the luck of the draw. SYSTEMATIC error depends only on the method, and a million badly recruited replies are still a million wrong replies. That is also why a serious poll publishes its method before its results.
Exercise 2: Mean, median and mode: which one tells the truth?
Three measures claim to summarize a data set with a single number, and they can give very different answers. Choosing the right one is a decision, not a calculation.
The eight annual salaries of a small business, in thousands of dollars: 32, 35, 38, 38, 41, 45, 52, 219. The last one is the owner's.
The graph below shows the data.
a) Compute the mean, the median and the mode.
b) How many employees earn LESS than the mean? Comment.
c) Recompute the mean and the median without the owner's salary. Which of the two measures moved the most?
d) A union and the management each quote one of these measures to describe the business. Match them, and say which one best describes the situation of an ordinary employee.
e) What can be deduced from comparing the mean and the median about the shape of the distribution?
Show the solution
Answers
a)x=62.5, median 39.5, mode 38 thousand dollars.
b)Seven employees out of eight earn less than the mean: it is pulled upward by the 219.
c)Mean 40.1, median 38. The mean moved by 22.4 against 1.5: fifteen times more.
d)The management quotes the mean, the union the median. The median describes the ordinary employee.
e)Mean greater than the median: distribution skewed to the right.
a)
The sum is 32+35+38+38+41+45+52+219=500, so the mean is x=8500=62.5 thousand dollars. For the median, the data are already sorted and n=8 is even: take the mean of the two central values, the fourth and the fifth, that is 238+41=39.5. The mode is 38, the only value that appears twice.
b)
SEVEN employees out of eight earn less than the mean of 62.5. Only the owner is above it. A mean with 87.5% of the data below it obviously does not describe a typical individual: it is PULLED upward by one extreme value, because computing the mean gives 219 the same weight as 32 even though it lies very far from it.
c)
Without the 219, the sum of the seven remaining salaries is 281, so the mean becomes 7281=40.1, and the median, the fourth value of a data set of seven, becomes 38. The mean dropped from 62.5 to 40.1, a change of 22.4; the median went from 39.5 to 38, a change of 1.5. The MEAN therefore moved fifteen times more: it is sensitive to extreme values, while the median is ROBUST.
d)
The management will quote the MEAN, 62,500 dollars, which gives the most flattering picture. The union will quote the MEDIAN, 39,500 dollars, closer to everyday reality. It is the median that best describes an ordinary employee, since by construction half earn less and half earn more. Neither is false: they answer different questions, and that is precisely why statistical agencies publish the MEDIAN income and not the mean income.
e)
The mean, 62.5, is clearly GREATER than the median, 39.5. This means that the distribution is SKEWED TO THE RIGHT, with a tail of a few high values that pull the mean. It is the typical shape of every distribution of incomes, of wealth and of company sizes. The opposite case, a mean smaller than the median, would correspond to a skew to the left; equality of the two is what a symmetric distribution shows.
Exercise 3: The standard deviation, and why we divide by n minus 1
Central tendency says nothing about spread. Two data sets with the same mean can be radically different, and it is the standard deviation that tells them apart.
Data set studied: 12, 15, 18, 20, 25.
The graph below shows the data.
a) Compute the mean, then draw up the table of the deviations from the mean and of their squares.
b) Why do we square the deviations instead of adding them directly?
c) Compute the variance and the standard deviation treating the data as a SAMPLE, then as a POPULATION.
d) Explain why we divide by n−1 in the case of a sample.
e) Compute the coefficient of variation and say what it is used for.
b)The sum of the raw deviations is zero by construction: without squaring, no spread can be measured.
c)Sample: s2=24.5 and s=4.95. Population: σ2=19.6 and σ=4.43.
d)The mean is estimated from the same data: only n−1=4 free deviations remain.
e)CV=27.5%. It compares the spread of data sets with different units.
a)
x=512+15+18+20+25=590=18. The deviations xi−x are −6, −3, 0, +2, +7, and their squares 36, 9, 0, 4, 49. The sum of the squares is 98.
b)
Because the sum of the RAW deviations is always ZERO: here −6−3+0+2+7=0, and it is no accident, it is a property of the mean. The positive deviations exactly cancel the negative ones, so their sum measures no spread at all. Squaring makes every term positive, which prevents the cancelling, and penalizes large deviations more than small ones. You could also take absolute values, which gives the mean absolute deviation, but the square is much easier to handle algebraically, which explains why it is used everywhere.
c)
As a SAMPLE: s2=5−198=24.5 and s=24.5≈4.95. As a POPULATION: σ2=598=19.6 and σ=19.6≈4.43. The sample version is therefore always the LARGER of the two.
d)
Because the mean x used in the calculation was itself ESTIMATED from the same data. The five deviations are therefore not independent: since their sum must be zero, knowing four of them determines the fifth. There are really only n−1=4 free deviations, which are called the degrees of freedom. Dividing by 5 would systematically underestimate the spread of the population the sample is drawn from; dividing by 4 corrects this bias. When you have the WHOLE population, the mean μ is not estimated but known, and the correction is no longer needed.
e)
CV=xs×100=184.95×100=27.5%. It is used to compare the spread of data sets that have neither the same unit nor the same order of magnitude. A standard deviation of 5 is huge for marks out of 20 and negligible for salaries in dollars: relative to the mean, the coefficient of variation becomes a percentage with no unit, directly comparable. It is commonly used to compare the consistency of two manufacturing processes or the volatility of two investments.
Exercise 4: The z-score: comparing what cannot be compared
Two marks obtained in two different groups cannot be compared directly. The z-score brings them back to a common scale by measuring the distance from the mean in number of standard deviations.
Anne scores 78 in a group with a mean of 70 and a standard deviation of 8. Benoît scores 85 in a group with a mean of 80 and a standard deviation of 10.
The figure below shows the situation.
a) Compute the z-score of each.
b) Which of the two has the better RELATIVE performance? Does the result surprise you?
c) What does a negative z-score mean? And a z-score of zero?
d) In a normal distribution, about 68% of the data lie within one standard deviation of the mean, 95% within two. Locate Anne and Benoît.
e) A company announces that its employees have a salary with a z-score of 1.5 relative to the industry mean, which is 55,000 dollars with a standard deviation of 6,000 dollars. What salary does this represent?
Show the solution
Answers
a)zAnne=1.00 and zBenoi^t=0.50.
b)Anne, despite a lower raw mark: she is a full standard deviation above her group.
c)Negative: below the mean. Zero: equal to the mean. The z-score has no unit.
d)Anne at the edge of the central 68%, about 16% do better; Benoît inside, about 31% do better. Neither reaches z=2.
e)x=55,000+1.5×6000=64,000 dollars.
a)
zAnne=878−70=88=1.00 and zBenoi^t=1085−80=105=0.50.
b)
ANNE, with a z-score of 1.00 against 0.50. The result is surprising at first, since her raw mark, 78, is LOWER than Benoît's 85. But Anne stands a full standard deviation above her group, while Benoît is only half a standard deviation above his. Measured against the difficulty of the test and the spread of the group, Anne's performance is therefore better. This is exactly the reasoning behind the R score used for university admission in Quebec.
c)
A NEGATIVE z-score means that the value is BELOW the mean of the group; its absolute value says by how many standard deviations. A z-score of ZERO means that the value is exactly equal to the mean. The z-score has no unit: it is the ratio of two quantities with the same unit, which is precisely what makes comparison possible between different distributions.
d)
Anne, at z=1.00, sits exactly at the edge of the interval containing the central 68%: about 16% of the students in her group do better than she does. Benoît, at z=0.50, is well inside this central interval; about 31% of his group do better. Neither reaches z=2, the threshold beyond which you enter the top 2.5% and speak of an exceptional performance.
e)
From z=sx−x we get x=x+zs=55,000+1.5×6000=55,000+9000=64,000 dollars. The z-score therefore reads both ways: it turns a value into a relative position, and a relative position into a value. Note in passing that the announcement is cleverly worded: it describes a salary of 64,000 dollars, better than that of about 93% of the industry, which is good but less spectacular than the statistical vocabulary suggests.
Exercise 5: Quartiles, box plots and outliers
Quartiles split the data into four equal parts and summarize its shape in five numbers. The 1.5 times the interquartile range rule gives an OBJECTIVE criterion for declaring a data value an outlier, instead of deciding it by eye.
Data: 12, 15, 18, 20, 22, 25, 28, 30, 32, 60.
The graph below shows the data.
a) Find the median, then Q1 and Q3.
b) Compute the interquartile range and give the five-number summary.
c) Apply the 1.5 times the interquartile range rule and identify the outliers.
d) Describe what the box plot looks like and what it reveals about symmetry.
e) Why is the interquartile range preferred to the range for measuring spread when there is an outlier?
d)Box from 18 to 30, line at 23.5, whiskers at 12 and 32, isolated point at 60. Median shifted to the left, distribution skewed to the right.
e)Range 48, dictated by the suspicious value; IQR=12, robust, like the median.
a)
The data set has n=10 values, already sorted. The median is the mean of the fifth and sixth: Q2=222+25=23.5. The lower half is 12, 15, 18, 20, 22, whose middle value is Q1=18. The upper half is 25, 28, 30, 32, 60, whose middle value is Q3=30.
b)
IQR=Q3−Q1=30−18=12. The five-number summary is: minimum 12, Q1=18, median 23.5, Q3=30, maximum 60.
c)
The fences are Q1−1.5IQR=18−18=0 and Q3+1.5IQR=30+18=48. Any value outside [0,48] is an outlier. The value 60 exceeds 48: it is the ONLY outlier in the data. All the other values are inside the interval.
d)
The box runs from 18 to 30, cut by a line at 23.5. The left whisker goes down to the smallest non-outlying value, 12; the right whisker goes up to 32, the last non-outlying value, and the 60 is marked separately by an isolated point. The median 23.5 is not in the centre of the box, it is shifted slightly to the left since 23.5−18=5.5 against 30−23.5=6.5: the upper half is a little more spread out. Combined with the high outlier, this indicates a distribution skewed to the RIGHT.
e)
Because the range rests only on the TWO extreme values, that is, precisely on the ones most likely to be outliers. Here the range is 60−12=48, a number entirely dictated by one suspicious data value, while the interquartile range is 12 and describes the central 50% of the data, without being affected by what happens at the ends. The interquartile range is therefore ROBUST, just like the median, and that is why the two naturally go together: the mean and the standard deviation on one side, the median and the interquartile range on the other.
Part B: Exam level (/50)
Exercise 6: The weighted mean and the trap of the mean of means
A CEGEP semester has four assessments, weighted 15%, 25%, 20% and 40%. A student scores 72, 65, 88 and 79 on them respectively.
The figure below shows the situation.
a) Compute her final mark, then the simple mean of the four marks. Why do they differ, and in which case would they be equal?
b) Before the final exam, what mark must she get on this last assessment to reach 80% overall?
c) Two groups take the same course: group A has 30 students and a mean of 68, group B has 12 with a mean of 80. A teacher announces that the mean of the two groups combined is 74. Compute the true value and explain the mistake.
d) Under what condition is the mean of means correct? State the general rule.
e) A student takes three courses worth 4, 2 and 3 credits and scores 80, 65 and 90. Compute her mean weighted by credits. Why weight this way rather than treat the three courses equally?
Show the solution
Answers
a)Final mark 76.25, simple mean 76.00. They would be equal if the four weights were equal.
b)Earned 44.65 points; she needs 0.4035.35≈88.4.
c)True mean 423000≈71.4, that is 2.6 points below the announcement: the group sizes were forgotten.
d)Only if all the subgroups have the same size; otherwise x=∑ni∑nixi.
e)9720=80.0. The credits measure the workload.
a)
Final mark: (0.15)(72)+(0.25)(65)+(0.20)(88)+(0.40)(79)=10.80+16.25+17.60+31.60=76.25. Simple mean: 472+65+88+79=4304=76.00. They differ because the weighted mean gives each mark an importance proportional to its weight: here, the 79 on the heaviest assessment counts for more than the 88 on the assessment worth 20%. The two would be equal if and only if all the weights were EQUAL, that is 25% each: the simple mean is just a special case of the weighted mean.
b)
The first three assessments bring in (0.15)(72)+(0.25)(65)+(0.20)(88)=44.65 points out of the 60% already assessed. She needs 80 overall, so 80−44.65=35.35 points must come from an assessment worth 40%: her mark must be 0.4035.35≈88.4. It is demanding but reachable, and the calculation shows exactly what weighting is for: an assessment worth 40% still leaves everything to play for.
c)
The true mean is computed over the 42 students combined: 42(30)(68)+(12)(80)=422040+960=423000≈71.4. The teacher computed 268+80=74, that is, the mean of the two means, which amounts to treating the two groups as if they had the same size. Yet the weaker group is two and a half times larger: it must weigh that much more. The gap, 2.6 points, is not trivial when cohorts are being compared.
d)
The mean of means is correct only if all the subgroups have the SAME size. In general, each mean must be weighted by the size of its group: x=∑ni∑nixi. The reason is that the overall mean is the sum of ALL the values divided by their number, and that the sum of the values of one group is nixi: the group size is already there, it cannot disappear. It is one of the most widespread errors in reports, because it is invisible: the wrong calculation looks perfectly reasonable.
e)
4+2+3(4)(80)+(2)(65)+(3)(90)=9320+130+270=9720=80.0. We weight by credits because they measure the workload: a 4-credit course represents twice as much learning as a 2-credit course, and it would be absurd for a minor course to count as much as a major one in the results of a semester. The principle is general: a weighted mean always expresses a judgement about the relative IMPORTANCE of the items, and that judgement is a decision, not a calculation. Changing the weights changes the mark without any result having changed.
Exercise 7: Data grouped into classes
When the data are numerous, they are grouped into classes and the individual values are lost. The formulas adapt by replacing each data value with the MIDPOINT of its class, which introduces a controlled approximation.
Distribution of the commuting times from home to the CEGEP, in minutes, for 50 students: [0, 10): 6 students; [10, 20): 14; [20, 30): 18; [30, 40): 9; [40, 50): 3.
The graph below shows the data.
a) Draw up the table of class midpoints and check the total frequency.
b) Compute the mean commuting time.
c) Compute the standard deviation, treating the 50 students as a population.
d) Find the modal class and the median class.
e) In what way is the result of b an approximation? In which case would it be exact?
Show the solution
Answers
a)Midpoints 5, 15, 25, 35, 45; total frequency 50.
b)∑nici=1140, so x=22.8 minutes.
c)∑ni(ci−x)2=5658, σ2=113.16, σ=10.6 minutes.
d)Modal class and median class: both [20,30).
e)Each data value was replaced by the midpoint of its class. Exact if the actual mean of each class equals its midpoint.
a)
The midpoint of each class is the mean of its two boundaries: 5, 15, 25, 35 and 45 minutes. The total frequency is 6+14+18+9+3=50, which matches the statement.
b)
x=n∑nici where ci is the class midpoint. The numerator is 6×5+14×15+18×25+9×35+3×45=30+210+450+315+135=1140. So x=501140=22.8 minutes.
c)
Compute ∑ni(ci−x)2. The deviations are −17.8, −7.8, 2.2, 12.2 and 22.2, whose squares are 316.84, 60.84, 4.84, 148.84 and 492.84. Weighted by the frequencies: 1901.04+851.76+87.12+1339.56+1478.52=5658. Then σ2=505658=113.16 and σ=113.16≈10.6 minutes.
d)
The MODAL class is the one with the largest frequency: [20,30) with 18 students. For the median class, look for where the 25th and 26th observations lie. The cumulative frequencies are 6, then 20, then 38: the 25th and 26th therefore fall in the third class. The MEDIAN class is also [20,30). The fact that they coincide, together with a mean of 22.8 close to the midpoint of that class, suggests a fairly symmetric distribution, with a slight skew to the right due to the long commutes.
e)
Because each of the 50 actual values was replaced by the MIDPOINT of its class, which amounts to assuming that the data are spread uniformly within each class, or at least symmetrically around the midpoint. If, for example, the 18 students in the class [20,30) were in fact all around 21 minutes, the true mean would be lower than 22.8. The result would be EXACT if, in each class, the actual mean of the data coincided with the midpoint of the class. In practice the errors largely cancel from one class to the next, and the approximation is excellent as soon as the classes are narrow enough and the frequencies large enough.
Exercise 8: The ogive: reading a percentile on a cumulative curve
Take again the distribution of the commuting times, in minutes, of 50 students: [0,10) has 6 students, [10,20) has 14, [20,30) has 18, [30,40) has 9 and [40,50) has 3. A histogram shows how the data are distributed; the OGIVE shows the running total, and it is on the ogive that percentiles are read.
The graph below shows the data.
a) Draw up the table of cumulative frequencies and cumulative percentages.
b) The ogive is drawn by plotting the cumulative frequency against the UPPER BOUNDARY of each class, not its midpoint. Justify this choice.
c) Find the median by linear interpolation within the median class, and compare with what could be read on the histogram.
d) Find the ninth decile and the first decile. What do they represent concretely for a transit service?
e) What proportion of students take more than 35 minutes? What assumption is made when interpolating, and in which case would it be wrong?
Show the solution
Answers
a)Cumulative frequencies 6, 20, 38, 47, 50, that is 12%, 40%, 76%, 94%, 100%.
b)The running total goes at the UPPER boundary: the class is only fully counted once it has been passed.
c)M=20+185(10)≈22.8 minutes. The histogram would only give the class [20,30).
d)D9≈37.8 min and D1≈8.3 min: one rider in ten takes more than 38 minutes.
e)Cumulative frequency 42.5 at 35 min, so 15% above. A uniform spread within each class is assumed.
a)
Cumulative frequencies: 6 at 10 min, 6+14=20 at 20 min, 20+18=38 at 30 min, 38+9=47 at 40 min, 47+3=50 at 50 min. As percentages: 12%, 40%, 76%, 94%, 100%. The last value must equal the total frequency exactly; it is the check to make every time.
b)
Because the cumulative frequency answers the question “how many students take LESS THAN so many minutes”. We only know for certain that 20 students are under 20 minutes once the class [10,20) has been entirely counted, that is, at its upper boundary. Plotting the running total at the midpoint of the class would amount to claiming that half the class is reached in the middle, which is precisely what we do not know. The ogive is therefore an increasing curve that starts from zero at the lower boundary of the first class and reaches the total frequency at the upper boundary of the last one.
c)
The median corresponds to the 25th student, that is 50% of 50. The cumulative frequency is 20 at 20 minutes and 38 at 30 minutes: the median therefore falls in the class [20,30). We must move 25−20=5 students into it out of the 18 in the class, a fraction 185 of its width of 10 minutes: M=20+185(10)≈22.8 minutes. On a histogram, we could only name the median class, [20,30), and go no further: that is the whole advantage of the ogive, which gives a value and not an interval.
d)
Ninth decile: 90% of 50 is 45 students. The cumulative frequency is 38 at 30 minutes and 47 at 40 minutes, so D9 is in [30,40): D9=30+945−38(10)≈37.8 minutes. First decile: 10% of 50 is 5 students, in the first class: D1=0+65(10)≈8.3 minutes. Concretely, one student in ten arrives in less than 8 minutes, and one in ten takes more than 38 minutes. For a transit service, it is this last figure that matters: planning on the mean would leave 10% of the riders in a situation clearly worse than what one believes has been provided for.
e)
At 35 minutes, we are in the middle of the class [30,40): the cumulative frequency is 38+105(9)=42.5 students, so 50−42.5=7.5 students take more than 35 minutes, that is 15%. The assumption made when interpolating is that the data are spread UNIFORMLY within each class, which allows the ogive to be treated as a series of straight-line segments. It is reasonable when the classes are narrow and the frequencies large, but it becomes wrong as soon as the spread inside a class is very uneven: if, in the class [30,40), all the students actually took 31 minutes, only the 3 students of [40,50) would take more than 35 minutes, and the exact answer would be 6%, not 15%. The remedy is the same as always: narrower classes, as long as the frequencies allow it.
Exercise 9: Linear transformations: what changes and what holds
A set of temperatures recorded in degrees Celsius has a mean of 18.0 °C and a standard deviation of 4.0 °C. We want to express the same data in degrees Fahrenheit, knowing that F=1.8C+32.
a) Compute the mean and the standard deviation of the data expressed in degrees Fahrenheit. Why does the 32 play no part in the second calculation?
b) State the general rule for a transformation y=ax+b: what happens to the mean, the variance and the standard deviation?
c) Compute the coefficient of variation in both units. What do you notice, and what conclusion do you draw about the use of the coefficient of variation?
d) A reading of 22 °C corresponds to 71.6 °F. Compute its z-score in both units. Prove that the z-score is INVARIANT under any linear transformation with a positive slope.
e) One teacher adds 5 points to every paper in a group, then another multiplies every mark by 1.1. Describe the effect of each operation on the mean, the standard deviation and the ranking of the students. What becomes of the data if we apply y=sx−x?
Show the solution
Answers
a)F=64.4 °F and sF=7.2 °F. The +32 shifts the data without changing the gaps.
b)y=ax+b, sy2=a2sx2, sy=∣a∣sx.
c)CV=22.2% in Celsius against 11.2% in Fahrenheit: the CV requires an absolute zero.
d)z=1.00 in both units. The b goes by subtraction, the a by cancellation.
e)+5: mean +5, standard deviation unchanged. ×1.1: both ×1.1. Ranking unchanged in both cases. Standardized: mean 0, standard deviation 1.
a)
Mean: F=1.8(18.0)+32=32.4+32=64.4 °F. Standard deviation: sF=1.8(4.0)=7.2 °F. The 32 plays no part because adding a constant SHIFTS the whole data set as a block, without bringing the values closer together or moving them apart: the gap between any two readings stays the same, and so does the spread. Only the multiplication by 1.8 stretches the gaps, and it stretches all of them by the same factor.
b)
For y=ax+b: y=ax+b, the variance becomes sy2=a2sx2 and the standard deviation sy=∣a∣sx. The absolute value matters: multiplying by −2 flips the data but doubles its spread, and a standard deviation can never be negative. Note also that the median and the quartiles follow the same rule as the mean, and that the range and the interquartile range follow the rule of the standard deviation.
c)
In Celsius: CV=18.04.0×100≈22.2%. In Fahrenheit: CV=64.47.2×100≈11.2%. The coefficient of variation was CUT IN HALF although no data value changed, only the unit. The conclusion is clear: the coefficient of variation only makes sense for a variable measured on a RATIO scale, that is, one with an absolute zero, such as a mass, a duration or an income. The Celsius and Fahrenheit temperatures have purely conventional zeros, so the ratio xs means nothing there. In kelvins, the question would become legitimate again.
d)
In Celsius: z=4.022−18.0=1.00. In Fahrenheit: z=7.271.6−64.4=7.27.2=1.00. Identical. Proof: if y=ax+b with a>0, then zy=syy−y=asx(ax+b)−(ax+b)=asxa(x−x)=sxx−x=zx. The b disappears by subtraction, the a by cancellation. This is exactly why the z-score makes it possible to compare measurements made in different units: it is the only indicator of the chapter that depends neither on the origin nor on the scale.
e)
Adding 5 points is y=x+5: the mean goes up by 5, the standard deviation does not move, and the ranking is strictly unchanged since everyone gains the same amount. Multiplying by 1.1 is y=1.1x: the mean and the standard deviation are both multiplied by 1.1, and the ranking also stays unchanged, since the function is increasing. No linear transformation with a positive slope can change an order, which explains why none changes the z-scores either. Finally, applying y=sx−x means taking a=s1 and b=−sx: the new data set has mean sx−x=0 and standard deviation ss=1. It is called the STANDARDIZED data set, and it is what makes two assessments marked on different scales comparable. The whole logic of the z-score, and of the standardized scores used for university admission, fits in these two lines.
Exercise 10: Problem: reading a statistic in the media
The main use of descriptive statistics, for a citizen, is not to be fooled. Three claims, all built on exact calculations, and yet all misleading.
We have the annual incomes of the households of a neighbourhood: median 48,000 dollars, mean 71,000 dollars, standard deviation 55,000 dollars.
a) “The mean income of the neighbourhood is 71,000 dollars, it is a well-off neighbourhood.” What is missing from this reading?
b) The standard deviation, 55,000, is almost as large as the mean. Compute the coefficient of variation and interpret it.
c) A developer claims: “half of the households earn more than 48,000 dollars”. Is it correct?
d) A second neighbourhood has the same median, 48,000, but a standard deviation of 12,000. Describe in one sentence the difference between the two neighbourhoods.
e) Suggest the three indicators you would publish to describe the first neighbourhood honestly, and justify each one.
Show the solution
Answers
a)The median is missing: 71,000 against 48,000, a gap of 47.9%, a sign of a right skew.
b)CV=77.5%: extreme heterogeneity, no “typical” income describes the neighbourhood.
c)Correct, it is the definition of the median. But one could just as truthfully say “half earn LESS”.
d)Same typical household, but the first neighbourhood is highly unequal, the second homogeneous, roughly between 24,000 and 72,000 dollars.
e)Median, interquartile range, and share of households below a low-income cut-off.
a)
The comparison with the MEDIAN is missing. The gap between 71,000 and 48,000 is considerable: the mean exceeds the median by nearly 50%, which reveals a distribution strongly skewed to the right. Concretely, a minority of very well-off households pulls the mean upward, while the typical household earns 48,000 dollars. Calling the neighbourhood well-off on the basis of the mean alone is describing a minority as if it were the norm.
b)
CV=71,00055,000×100=77.5%. Such a high coefficient of variation signals extreme heterogeneity: the spread is of the same order of magnitude as the average level itself. This neighbourhood has no “typical” income in the usual sense; it puts side by side very different situations. Any single measure of central tendency, whichever it is, will necessarily mislead there.
c)
YES, it is correct, and it is even the definition of the median: half of the households earn more than 48,000 dollars and the other half less. The claim is beyond reproach on substance. It is still slanted by what it leaves out: one could just as truthfully write that half of the households earn LESS than 48,000 dollars. Choosing to present the upper half rather than the lower half is a rhetorical choice, not a statistical one.
d)
The two neighbourhoods have the same typical household, but the first is highly UNEQUAL while the second is HOMOGENEOUS: in the second, if incomes are spread roughly in a bell shape around the median, about 95% of households lie within two standard deviations of it, between 24,000 and 72,000 dollars, whereas in the first, incomes spread over a range several times wider. Two neighbourhoods with the same median can therefore offer entirely different social realities, which no measure of central tendency can reveal on its own.
e)
First, the MEDIAN, 48,000 dollars, as the measure of the typical household, because it resists the extreme values that are clearly present here. Second, the INTERQUARTILE RANGE, or failing that the quartiles themselves, because it describes the spread of the central 50% without being distorted by the tail of the distribution, unlike the standard deviation of 55,000, which is itself inflated by the high incomes. Third, the share of households below a reference THRESHOLD, for example the low-income cut-off, because a position indicator answers the real social question where no numerical summary does. One could add a histogram, which remains the most honest way to present a distribution: it summarizes nothing and therefore hides nothing.
Something missing from this set?A type of exercise your teacher gives, a problem you are stuck on, a mistake you spotted: tell me, I read every request.
Sending goes through your free space: that is how I can answer you and tell you when the exercise is added. An email is enough, no password. Create your space.
Rather not create an account? Write to me directly.
Get in touch for a first session. We work through 201-337 at the level of real CEGEP tests, from choosing between the mean and the median to reading an ogive and comparing results with z-scores.