Corrected practice final exam in advanced statistics (201-337)
This is a practice final exam with full solutions for 201-337, Advanced Statistics, the CEGEP statistics course that covers descriptive statistics, probability and distributions, estimation, hypothesis testing and regression.
It is calibrated on a real final exam: 12 exercises, 100 marks, 3 hours. The difference from the chapter sets is deliberate, and it is the whole point of the exercise: every question draws on several parts of the course and none announces its method. It is up to you to recognize whether you need an interval, a test, a discrete distribution or a regression, which is exactly the skill the final exam assesses.
Four parts of 25 marks. Part A describes and models data: a sample confronted with a normal model (exercise 1), Chebyshev's inequality when normality cannot be assumed (exercise 2) and the sample size of a survey (exercise 3). Part B is on probability and distributions: Bayes' theorem on a screening test (exercise 4), the binomial, Poisson and normal distributions for the same count (exercise 5) and the central limit theorem applied to a game of chance (exercise 6). Part C is on deciding under uncertainty: type I and type II errors and power (exercise 7), the duality between confidence interval and test (exercise 8) and the chi-square goodness-of-fit test (exercise 9). Part D holds three synthesis problems: Simpson's paradox (exercise 10), regression with its confidence and prediction intervals (exercise 11) and five misleading claims to correct (exercise 12).
All the critical values you need are given in the statements, so there is no table to look up.
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.
•Sample standard deviation: s=n−1∑(xi−x)2. z-score: z=sx−x.
•Chebyshev's inequality: for ANY distribution and any k>1, at least 1−k21 of the data lie within k standard deviations of the mean. The 68-95-99.7 rule is more precise, but it requires normality.
•Standard error of the mean: nσ. Sample size for a margin E: n=(Ezσ)2 for a mean, n=(Ez)2p(1−p) for a proportion, with p=0.5 in the worst case.
•Validity conditions: Poisson approximation if n≥50 and p≤0.1; normal approximation to the binomial if np≥5 AND n(1−p)≥5.
•Type I error: rejecting H0 when it is true, with probability α. Type II error: not rejecting H0 when it is false, with probability β. The power is 1−β, and it is always computed against a specific value of the alternative hypothesis.
•Chi-square: χ2=∑E(O−E)2. For a goodness-of-fit test with k categories, the number of degrees of freedom is k−1.
•Regression: b=SxxSxy, a=y−bx, r=SxxSyySxy and se=n−2Syy−bSxy.
•A confidence interval brackets the MEAN of y for a given x; a prediction interval brackets ONE future observation, and it is always wider.
Part A: Describing and modelling (/25)
Exercise 1: From a raw sample to the model that describes it
The durations, in minutes, of twelve home-to-work commutes are recorded: 18, 22, 25, 25, 27, 28, 30, 31, 33, 35, 38, 44.
Recall that for the standard normal distribution, P(Z>1.44)≈0.0749 and P(Z>2.00)≈0.0228.
The graph below shows the data.
a) Compute the mean and the standard deviation of this sample, rounded to the thousandth.
b) An employer claims that the commute time follows a normal distribution with the same parameters. Under this model, what is the probability that a commute takes more than 40 minutes?
c) What proportion of the sample actually exceeds 40 minutes? Compare with b) and comment.
d) Compute the z-score of the 44-minute commute. Should it be treated as an outlier?
Show the solution
Answers
a)x≈29.667 min and s≈7.165 min.
b)z≈1.44, so P(X>40)≈0.0749, about 7.5%.
c)One commute out of twelve, that is 8.3%. Close to the 7.5%, but twelve observations validate nothing.
d)z≈2.00, right at the limit of the usual criterion. It is not discarded: 44 minutes is plausible.
a)
The sum is 356, so x=12356≈29.667 minutes. The sum of the squared deviations is about 564.667, and dividing by n−1=11 gives a variance of about 51.333, so s≈7.165 minutes.
b)
Compute the z-score of the cutoff: z=7.16540−29.667≈1.44. So P(X>40)=P(Z>1.44)≈0.0749, about 7.5%.
c)
Only one commute out of twelve exceeds 40 minutes, that is 121≈0.0833, about 8.3%. The two values are close, which is rather reassuring for the model. But the conclusion must stay cautious: with twelve observations, a single commute more or less above 40 minutes would move the empirical proportion to 0 or to 16.7%. A sample of this size can neither seriously confirm nor seriously refute a normality assumption.
d)
z=7.16544−29.667≈2.00. The usual criterion puts the boundary at ∣z∣>2, sometimes at ∣z∣>3: the value is therefore right at the limit, and certainly not beyond all suspicion. It must not be discarded. A value is not an outlier because it is large, but because there is a reason to believe it comes from a measurement error or from another population. Here, 44 minutes is a perfectly plausible commute time.
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.
Exercise 2: When the empirical rule is not allowed
A production line fills bags. The mass has a mean of 500 grams and a standard deviation of 80 grams, but the distribution is clearly skewed: nothing allows us to assume it is normal.
Recall that for a normal distribution, P(∣Z∣<2)≈0.9545 and P(∣Z∣<3)≈0.9973.
a) State Chebyshev's inequality and apply it with k=2. What interval of masses do you get, and what minimum proportion of the bags lies in it?
b) Do the same with k=3.
c) Compare, for k=2 and then k=3, Chebyshev's bound with the exact value a normal distribution would give. What does giving up the normality assumption cost?
d) A bag weighs 740 grams. What can be said about how often such deviations occur, with and without the normality assumption?
e) A quality inspector writes: “since 95% of the bags are between 340 and 660 grams, production is compliant.” Correct the sentence.
Show the solution
Answers
a)[340,660] g, at least 75% of the bags.
b)[260,740] g, at least 88.9% of the bags.
c)Normal: 95.45% and 99.73%. Beyond three standard deviations, Chebyshev allows 11.1% against 0.27%, forty times more.
d)z=3: at most 11.1% of the bags deviate that much, against 0.27% under the normal.
e)Chebyshev gives at least 75%, not 95%. And compliance is judged against tolerances set in advance, not against the observed spread.
a)
Chebyshev's inequality states that for any distribution, whatever its shape, and for any k>1, the proportion of data within k standard deviations of the mean is at least 1−k21. With k=2: the interval is 500±2×80, that is [340,660] grams, and it contains at least 1−41=0.75, so at least 75% of the bags.
b)
With k=3: the interval is 500±240, that is [260,740] grams, and it contains at least 1−91≈0.8889, so at least 88.9% of the bags.
c)
For k=2, Chebyshev guarantees 75% whereas the normal distribution would give 95.45%. For k=3, Chebyshev guarantees 88.9% against 99.73%. The gap is considerable, especially in the tails: beyond three standard deviations, the normal distribution leaves 0.27% of the data, while Chebyshev allows up to 11.1%, about forty times more. Giving up normality is therefore very costly in precision. In return, Chebyshev's bound holds without any condition, and that is its whole point: it can never be proved wrong.
d)
740 grams corresponds exactly to z=80740−500=3. Without any assumption on the shape of the distribution, only one thing can be stated: at most 11.1% of the bags lie more than three standard deviations from the mean, in either direction, so at most 11.1% weigh more than 740 grams or less than 260. If the distribution were normal, these two tails together would hold only 0.27%, and a 740-gram bag would be a remarkable event. Here it is not necessarily one.
e)
Two mistakes. First, Chebyshev's inequality does not give 95% but at least 75%: the inspector applied the empirical rule, which assumes normality, whereas the statement rules it out. Second, and more serious, compliance has nothing to do with this calculation: it is judged against tolerances set in advance, not against the observed spread. A very irregular production always satisfies Chebyshev; that does not make it compliant.
Exercise 3: How many observations do you really need?
A polling institute is preparing two surveys, both at the 95% confidence level, for which z=1.96.
The first is about a mean, monthly income, whose standard deviation is known from earlier records to be about 15 units. The second is about a proportion, that of people in favour of a measure.
a) What sample size is needed to estimate mean income with a margin of error of 2 units?
b) What size is needed to estimate the proportion with a margin of 3 percentage points, without any prior information on p?
c) A pilot survey suggests that p is around 0.2. Recompute the required size and comment on the difference with b).
d) The institute is considering running survey b) in Quebec, which has about 9 million inhabitants, rather than in a province of 150,000 inhabitants, and thinks the larger population will require a larger sample. Is it right?
Show the solution
Answers
a)n=216.09, so 217 people.
b)With p=0.5: n=1067.11, so 1068 people.
c)With p=0.2: n=682.95, so 683 people, that is 36% fewer.
d)No: the population size appears nowhere. 1068 respondents give the same margin everywhere.
a)
Isolate n in E=nzσ, which gives n=(Ezσ)2=(21.96×15)2=(14.7)2=216.09. A sample size is always rounded UP, otherwise the target margin is not reached: 217 people are needed.
b)
Here n=(Ez)2p(1−p), and without information on p we take the value that maximizes p(1−p), namely p=0.5, which gives p(1−p)=0.25. Then n=(0.031.96)2×0.25≈4268.44×0.25≈1067.11, so 1068 people. This is the famous “plus or minus 3%” of opinion polls, which corresponds to about a thousand respondents.
c)
With p=0.2, p(1−p)=0.16 and n≈4268.44×0.16≈682.95, so 683 people. That is 36% fewer than in b) for the same precision. Prior information, even approximate, saves about a third of the cost of the survey, because the variance of a proportion drops sharply as soon as you move away from 0.5.
d)
No, the institute is wrong. The formulas above nowhere contain the size N of the population: precision depends on the number of people surveyed, not on the share of the population they represent. As long as the sample is less than 5% of the population, which is the case in both provinces, 1068 respondents give exactly the same margin of error. It is one of the most counter-intuitive results of the course, and it is the reason why a national poll and a municipal poll survey the same number of people.
Part B: Probability and distributions (/25)
Exercise 4: A screening test, from Bayes to the decision
A disease affects 0.8% of a population. A screening test detects 95% of the people who have the disease, and it comes out positive for 4% of healthy people.
Probabilities are rounded to four decimal places.
a) Translate the data of the statement into probabilities, clearly naming the events.
b) Compute the probability that a person chosen at random gets a positive result.
c) A person tests positive. What is the probability that this person actually has the disease?
d) A person tests negative. What is the probability that this person is actually healthy?
e) The test is described as “95% reliable.” Explain why this wording is misleading, then say what would change if the test were applied only to a high-risk population in which the disease affects 30% of people.
c)0.047280.0076≈0.1607: more than four positives out of five are false alarms.
d)P(T)=0.9527 and the probability of being healthy is 0.9996: the test reassures well but alarms poorly.
e)“95% reliable” is the sensitivity, not the predictive value. In the high-risk population, the latter rises to 0.9105.
a)
Let D be the event “the person has the disease” and T the event “the test is positive.” The statement gives P(D)=0.008, the sensitivity P(T∣D)=0.95, and the false positive rate P(T∣D)=0.04, which is equivalent to a specificity P(T∣D)=0.96.
b)
By the law of total probability: P(T)=0.008×0.95+0.992×0.04=0.0076+0.03968=0.04728, about 4.73%.
c)
P(D∣T)=P(T)P(D∩T)=0.047280.0076≈0.1607. A person who tests positive therefore has only about a 16% chance of having the disease: more than four positives out of five are false alarms. The reason is arithmetic, not medical: healthy people are so numerous that their 4% of false positives, about 39.7 people per thousand, swamp the 7.6 true positives per thousand.
d)
P(T)=0.008×0.05+0.992×0.96=0.0004+0.95232=0.95272, so P(D∣T)=0.952720.95232≈0.9996. A negative result, on the other hand, is almost certain. The test is excellent at reassuring and poor at raising the alarm.
e)
“95% reliable” refers to the sensitivity, that is, a conditional probability GIVEN that the person has the disease. But the patient who receives the result is asking the reverse question: what is the probability of having the disease given that the test is positive? The two numbers, 95% and 16%, are both correct and do not describe the same thing; confusing them is the error of inverting conditional probabilities. In a high-risk population where P(D)=0.3, we would have P(T)=0.3×0.95+0.7×0.04=0.285+0.028=0.313 and P(D∣T)=0.3130.285≈0.9105. The same test, without any of its characteristics changing, then becomes highly conclusive. This is why a rare disease is not screened for in the general population: the value of a test depends as much on who is tested as on the test itself.
Exercise 5: Three distributions for the same count
A machine produces parts, 2% of which are defective, independently of one another. A batch of 200 parts is sampled and X denotes the number of defective parts.
Recall that the Poisson approximation is accepted when n≥50 and p≤0.1, and the normal approximation when np≥5 and n(1−p)≥5.
a) Justify that X follows a binomial distribution and give its parameters, its expected value and its standard deviation.
b) Compute P(X=3) with the exact binomial distribution, to four decimal places.
c) Compute the same probability with the Poisson approximation and compare.
d) Can the normal approximation be used here? Justify with the conditions, without doing the calculation.
e) The machine goes out of adjustment and the defect rate rises to 40%. Redo questions c) and d): which of the two approximations becomes legitimate, and which one stops being so?
Show the solution
Answers
a)X∼B(200,0.02), E(X)=4 and σ≈1.9799.
b)(3200)=1313400 and P(X=3)≈0.1963.
c)Poisson with λ=4: P(X=3)≈0.1954, within one thousandth of the exact value.
d)No: np=4<5. The distribution is too skewed.
e)With p=0.4: np=80 and n(1−p)=120, the normal becomes legitimate; p>0.1, so Poisson is no longer valid.
a)
The same two-outcome trial, defective or not, is repeated 200 times with a constant probability and independent draws: X follows the binomial distribution with parameters n=200 and p=0.02. Its expected value is np=4 parts and its standard deviation np(1−p)=3.92≈1.9799.
b)
P(X=3)=(3200)(0.02)3(0.98)197. With (3200)=1313400, we get P(X=3)≈0.1963.
c)
The Poisson approximation uses λ=np=4: P(X=3)≈3!e−4×43=664e−4≈0.1954. The gap with the exact value is less than one thousandth, a relative error of about 0.5%. The conditions are indeed met since n=200≥50 and p=0.02≤0.1.
d)
No. The condition np≥5 is not satisfied: np=4. This is consistent with the shape of the distribution, which is very skewed here since it stops at zero on one side and spreads out on the other, whereas the normal distribution is symmetric. Approximating such a distribution by a normal one would even give nonzero probabilities to negative values of X, which makes no sense for a count.
e)
With p=0.4: np=80 and n(1−p)=120, both far above 5, so the normal approximation becomes perfectly legitimate. On the other hand, the condition p≤0.1 no longer holds, and the Poisson approximation stops being valid. The two approximations are therefore complementary rather than competing: Poisson is for rare events over a large number of trials, the normal for situations where the expected value and its complement are both comfortably large. In between, the exact binomial is always available.
Exercise 6: From a probability distribution to the mean of a sample
A carnival game costs 2 units per play. It pays out 3 units with probability 0.3 and 12 units with probability 0.1; otherwise it pays nothing.
Let X be the player's net gain for one play, that is, what the player receives minus what was staked.
Recall that P(Z<−0.28)≈0.3897.
a) Find the probability distribution of X.
b) Compute the expected value and the standard deviation of X. Is the game fair for the player?
c) A player plays 100 times. What is the approximate distribution of the player's MEAN gain per play, and why?
d) Compute the probability that this player ends up losing over the 100 plays as a whole.
e) The game's operator collects the plays of thousands of players. Explain why the operator's situation is not symmetric to the player's, even though the expected value per play has the same size for everyone.
Show the solution
Answers
a)X=−2 with 0.6, X=1 with 0.3, X=10 with 0.1.
b)E(X)=0.1, E(X2)=12.7, Var(X)=12.69, σ≈3.5623. The game is slightly favourable to the player.
c)Approximately normal, with expected value 0.1 and standard error 0.3562, by the central limit theorem.
d)z≈−0.28, so about 0.3897: nearly a 39% chance of walking away a loser.
e)The operator's standard error drops to 0.0113, one ninth of the expected value: randomness disappears for the operator.
a)
The player stakes 2 units in every case. The player therefore gains 3−2=1 with probability 0.3, 12−2=10 with probability 0.1, and 0−2=−2 with the remaining probability 1−0.3−0.1=0.6. The distribution of X thus takes the values −2, 1 and 10 with respective probabilities 0.6, 0.3 and 0.1.
b)
E(X)=−2×0.6+1×0.3+10×0.1=−1.2+0.3+1=0.1 unit. Then E(X2)=4×0.6+1×0.3+100×0.1=2.4+0.3+10=12.7, so Var(X)=12.7−0.12=12.69 and σ≈3.5623. Since the expected value is strictly positive, the game is even slightly favourable to the player, which is unusual. But the standard deviation is thirty-five times the expected value: the advantage is drowned in randomness.
c)
By the central limit theorem, the mean of 100 independent, identically distributed variables is approximately normal, whatever the original distribution, which here is clearly not normal since it takes only three values. This mean has expected value 0.1 and standard error 1003.5623≈0.3562.
d)
Losing overall means that the mean gain is negative. Compute z=0.35620−0.1≈−0.28, so the probability is about 0.3897. In other words, despite a favourable game, the player has nearly a 39% chance of walking away a loser after a hundred plays.
e)
The expected value per play has the same size, but the opposite sign for the operator, who LOSES 0.1 unit on average per play made against them: as designed, this game is a losing one for the house. Above all, the standard error decreases like n1: for the player and their 100 plays it is 0.356, three and a half times the expected value, whereas for the operator and their 100,000 plays it is 1000003.5623≈0.0113, about one ninth of the expected value. Randomness dominates for one and vanishes for the other. This is exactly the mechanism casinos and insurance companies rely on: the same expected value becomes a near certainty once there are enough repetitions. Here it works against the operator, who is almost sure to lose about 0.1 unit per play over 100,000 plays; a real casino sets its prices so that this near certainty is a gain.
Part C: Deciding under uncertainty (/25)
Exercise 7: The two errors of a test, and what they cost
A machine is supposed to fill boxes with 500 grams. The standard deviation of the process is known and equals 8 grams. An inspector samples 25 boxes and wants to detect underfilling.
The inspector tests H0:μ=500 against H1:μ<500 at the significance level α=0.05, for which the critical value is z=−1.645.
Recall that P(Z>0.855)≈0.1963 and P(Z>1.48)≈0.0694.
a) Compute the standard error of the mean, then the mean mass below which the inspector will reject H0.
b) Define the type I error in this precise context, and give its probability.
c) The machine is actually set to 496 grams. Define the type II error here, compute its probability, then the power of the test.
d) Redo c) if the machine is set to 495 grams. What do you notice?
e) The inspector wants to reduce both risks at once. What are the options, and which one is the only truly satisfactory one?
Show the solution
Answers
a)Standard error 1.6 g, critical mass 497.368 g.
b)Wrongly accusing a correctly set machine; probability α=0.05 by construction.
c)Letting real underfilling pass. z≈0.855, β≈0.1963, power ≈0.8037.
d)z=1.48, β≈0.0694, power ≈0.9306: the power grows with the size of the misadjustment.
e)Lowering α or raising the detection threshold only slides the cursor. Only increasing n reduces both risks.
a)
The standard error is nσ=258=1.6 grams. The decision rule rejects H0 when x<500−1.645×1.6=500−2.632=497.368 grams.
b)
The type I error consists in concluding that the machine underfills when it is in fact correctly set to 500 grams. Its probability is α=0.05 by construction: the inspector chose it by setting the significance level. In concrete terms, a perfectly compliant machine will be wrongly accused once in twenty.
c)
The type II error consists in not rejecting H0, and so letting the machine pass, when it really does underfill. If the true mean is 496, β=P(X>497.368∣μ=496)=P(Z>1.6497.368−496)=P(Z>0.855)≈0.1963. The power is therefore 1−β≈0.8037: the test detects this misadjustment about four times out of five.
d)
With μ=495: z=1.6497.368−495=1.48, so β≈0.0694 and the power reaches about 0.9306. The power increases as the misadjustment gets worse, which is reassuring and perfectly logical: the larger the gap to detect, the easier it is to detect. A test therefore never has ONE power, it has one for each value of the alternative hypothesis, and stating a power without saying against what makes no sense.
e)
Three options. Lowering α reduces the first risk but moves the cutoff down, and so increases β: for a fixed sample size the two risks move in opposite directions, you only slide the cursor, and the trade-off is then settled by the cost of each error, a compliant machine wrongly accused against an underserved customer who goes unnoticed. Accepting a larger misadjustment as the detection threshold reduces β but amounts to giving up on detecting small deviations. The only option that truly improves both at once is to INCREASE n: the standard error decreases like n1, the two distributions tighten and overlap less, so that α=0.05 can be kept while β goes down. It is the only lever in statistics that trades no risk for another, and it is paid for in data collection.
Exercise 8: Confidence interval and test: two ways of saying the same thing
A manufacturer advertises a mean lifetime of 100 hours. A laboratory tests 16 units and obtains a mean of 104.5 hours with a sample standard deviation of 8 hours. The population standard deviation is unknown.
For 15 degrees of freedom, the two-sided critical values are t=2.131 at the 5% level and t=2.947 at the 1% level.
a) Justify the choice of Student's t distribution rather than the normal distribution, then compute the test statistic for H0:μ=100 against H1:μ=100.
b) Conclude at the 5% level, then at the 1% level.
c) Build the 95% confidence interval for the mean lifetime, then the 99% one.
d) Compare the conclusions of b) with the intervals of c). State the general rule this comparison illustrates.
e) The sample has only 16 units. What additional assumption is then essential, and would it still be with 200 units?
Show the solution
Answers
a)Student's t with 15 degrees of freedom, since σ is unknown. t=24.5=2.25.
b)Reject at 5% since 2.25>2.131; do not reject at 1% since 2.25<2.947.
c)At 95%: [100.238,108.762]. At 99%: [98.606,110.394].
d)The two approaches agree: a two-sided test at level α rejects if and only if the 1−α interval excludes the tested value.
e)The population must be assumed normal. With 200 units, the central limit theorem would make the assumption unnecessary.
a)
The population standard deviation is unknown and replaced by the sample's: the statistic then follows a Student t distribution with n−1=15 degrees of freedom, not a normal distribution. We compute t=s/nx−μ0=8/4104.5−100=24.5=2.25.
b)
At the 5% level, ∣t∣=2.25>2.131: reject H0, the mean lifetime differs significantly from 100 hours. At the 1% level, ∣t∣=2.25<2.947: do not reject H0. The conclusion therefore depends on the level, which is normal and must be stated, never hidden.
c)
The interval is x±t×ns, with ns=2. At 95%: 104.5±2.131×2=104.5±4.262, that is [100.238,108.762]. At 99%: 104.5±2.947×2=104.5±5.894, that is [98.606,110.394].
d)
The 95% interval does NOT contain the value 100, and the test at the 5% level rejects. The 99% interval contains 100, and the test at the 1% level does not reject. The two approaches agree perfectly, and this is no coincidence: a two-sided test at level α rejects H0:μ=μ0 if and only if the confidence interval at level 1−α does not contain μ0. Both calculations handle the same quantity, one starting from μ0 and going toward the data, the other starting from the data to delimit the compatible values of μ0. The interval is in fact more informative: it does not only say that 100 is rejected, it gives all the values that would not be.
e)
With n=16, we must assume that the lifetime itself follows an approximately normal distribution in the population: Student's t distribution is exact only under this condition, and the central limit theorem has not had time to act on such a small sample. With n=200, this assumption would become practically unnecessary, because the central limit theorem makes the mean approximately normal whatever the original distribution. This is the real issue with small samples: it is not only that the intervals are wide, it is that their very validity rests on an assumption that cannot be checked with so little data.
Exercise 9: Chi-square: is the die fair?
A six-sided die is rolled 120 times and the following frequencies are recorded: 15 times a 1, 18 times a 2, 24 times a 3, 27 times a 4, 14 times a 5 and 22 times a 6.
For a chi-square test with 5 degrees of freedom, the critical value at the 5% level is 11.070.
The graph below shows the data.
Face
1
2
3
4
5
6
Observed frequency
15
18
24
27
14
22
a) State the two hypotheses of the test and compute the expected frequencies under H0.
b) Compute the chi-square statistic and conclude at the 5% level.
c) The experiment is continued up to 600 rolls and exactly the same proportions are obtained, namely 75, 90, 120, 135, 70 and 110. Recompute the statistic and conclude.
d) The observed proportions are identical in both cases, and yet the conclusions differ. Explain precisely why.
e) This test is about a single variable. How does it differ, in its construction, from a chi-square test of independence between two variables?
Show the solution
Answers
a)H0: fair die, 61 per face. Expected frequency: 20 per face.
b)χ2=20134=6.7<11.070: do not reject. Nothing allows us to claim the die is loaded.
c)Expected frequency 100, χ2=1003350=33.5>11.070: reject, the die is loaded.
d)At constant proportions, the statistic is proportional to n: 5×6.7=33.5. The critical value does not move.
e)Goodness of fit: distribution given in advance, k−1 degrees of freedom. Independence: expected frequencies from the marginal totals, (r−1)(c−1) degrees.
a)
H0: the die is fair, each face has probability 61. H1: at least one face departs from this probability. Under H0, the expected frequency is 120×61=20 for each of the six faces. The validity condition is satisfied since all the expected frequencies exceed 5.
b)
The squared deviations are 25, 4, 16, 49, 36 and 4, with a sum of 134. So χ2=20134=6.7. Since 6.7<11.070, we do not reject H0: nothing allows us to claim that the die is loaded. Be careful with the wording: we do not conclude that the die is fair.
c)
The expected frequencies become 6600=100. The squared deviations are 625, 100, 400, 1225, 900 and 100, with a sum of 3350, so χ2=1003350=33.5. This time 33.5>11.070 and H0 is rejected by a wide margin: the die is loaded.
d)
Because the chi-square statistic is proportional to the sample size when the proportions stay constant. Multiplying the frequencies by 5 multiplies each deviation O−E by 5 as well, and its square by 25, while the denominator E is only multiplied by 5: the ratio is therefore multiplied by 5, and we do get 5×6.7=33.5. The critical value, for its part, depends only on the number of degrees of freedom and does not move. In other words, the same relative imbalance becomes detectable as soon as it is observed long enough: a test does not measure the size of a deviation, it measures our ability to rule out chance, and that ability grows with the data.
e)
The difference lies in how the expected frequencies are computed and in the number of degrees of freedom. In a goodness-of-fit test, the theoretical distribution is given in advance, here equal probabilities, and k categories are compared, hence k−1=5 degrees of freedom. In a test of independence, no distribution is supplied: the expected frequencies are built from the marginal totals of the table itself, by E=grand totalrow total×column total, and the number of degrees of freedom becomes (r−1)(c−1), for r rows and c columns. The statistic is then computed the same way in both cases.
Part D: Synthesis problems (/25)
Exercise 10: Problem: Simpson's paradox
A university offers only two programs, A and B. The table gives, for each, the number of applications and the number of admissions, separately for men and for women.
An advocacy group accuses the university of discriminating against women in admissions.
Program
Men: applicants
Men: admitted
Women: applicants
Women: admitted
A
400
240
100
65
B
100
20
400
100
a) Compute, in each program separately, the admission rate of men and that of women. Who is favoured?
b) Now compute the overall admission rate of men and that of women, all programs combined. Who is favoured?
c) Answers a) and b) contradict each other. Compute the overall admission rate of each program, then how each sex's applications are split between the two programs.
d) Explain the mechanism of the reversal.
e) Is the accusation of discrimination in admissions justified? State what these data allow us to conclude, and what they do not.
Show the solution
Answers
a)A: 60.0% against 65.0%. B: 20.0% against 25.0%. Women are favoured in BOTH programs.
b)Men 52.0%, women 33.0%: overall, the advantage goes to men.
c)A admits 61.0%, B only 24.0%. 80% of men's applications go to A, 80% of women's to B.
d)The overall rate is an average weighted by how the applications are distributed. This is Simpson's paradox.
e)The charge of discrimination IN ADMISSIONS is not justified. The 19-point gap comes from how the applications are distributed, and these data do not explain where that comes from.
a)
Program A: men obtain 400240=60.0% and women 10065=65.0%. Program B: men obtain 10020=20.0% and women 400100=25.0%. In each of the two programs, without exception, women are admitted more often than men.
b)
Overall, men total 240+20=260 admissions for 400+100=500 applications, that is 52.0%. Women total 65+100=165 admissions for 100+400=500 applications, that is 33.0%. Overall, then, it is men who are admitted far more often, and the gap is huge.
c)
Program A admits 500305=61.0% of its applicants, program B only 500120=24.0%: A is not very selective, B is highly selective. Now men submitted 400 of their 500 applications to A, that is 80%, while women submitted 400 of their 500 to B, also 80%, but in the difficult program.
d)
The overall rate of a group is an average of the rates per program, weighted by how its applications are distributed. Men applied massively where 61% of applicants are admitted, women where only 24% are. This difference in weighting, which is considerable, outweighs the five-point advantage women enjoy in each program. This is Simpson's paradox: an association observed in every subgroup can reverse in the aggregate, as soon as a third variable, here the choice of program, is linked both to the group and to the outcome.
e)
The accusation, as worded, is not justified: in admissions, that is, once the program is chosen, women are favoured everywhere. What the data show is an overall gap of 19 points produced entirely by how the applications are distributed. What the data cannot tell us is WHY this distribution is what it is, nor whether some upstream mechanism, academic guidance, information, stereotypes, steers women toward the more selective program. The question therefore remains open, but it moves from admission to application. The methodological lesson is general: never aggregate subgroups without checking whether membership in a subgroup itself depends on the variable under study.
Exercise 11: Problem: from regression to prediction, with its uncertainty
For six students, the number of hours of study x and the mark obtained y out of 100 are recorded.
For 4 degrees of freedom, the two-sided critical value at the 5% level is t=2.776.
The graph below shows the data.
Hours x
2
4
5
7
8
10
Mark y
52
58
63
70
74
81
a) Compute Sxx, Syy and Sxy, then the equation of the least-squares line.
b) Compute the correlation coefficient and the coefficient of determination. Interpret the latter.
c) Compute the standard error of the estimate se.
d) For 6 hours of study, give the 95% confidence interval for the MEAN mark, then the 95% prediction interval for the mark of ONE student. Explain why the second is wider.
e) A student plans to study for 20 hours. What does the model predict, and what should we make of it?
Show the solution
Answers
a)Sxx=42, Syy≈573.333, Sxy=155, so y^≈3.6905x+44.1905.
b)r≈0.99886 and r2≈0.9977: 99.8% of the variation explained, which is suspicious on six points.
c)Residual sum ≈1.3095, so se≈0.5722 point.
d)y^≈66.333. Confidence: ±0.648. Prediction: ±1.716, almost three times wider, because it adds the individual spread.
e)y^≈118, impossible: extrapolation outside [2,10] hours, and a mark levels off, which a straight line never does.
a)
We have x=636=6 and y=6398≈66.333. Then Sxx=∑(x−x)2=16+4+1+1+4+16=42, Syy≈573.333 and Sxy=155. The slope is b=42155≈3.6905 and the y-intercept a=66.333−3.6905×6≈44.1905. The line is therefore y^≈3.6905x+44.1905: each additional hour of study is worth about 3.7 points.
b)
r=SxxSyySxy=42×573.333155≈0.99886, so r2≈0.9977. About 99.8% of the variation in marks is explained by the variation in the number of hours. That is extraordinarily high for human data, and it should raise suspicion: the marks of a real group of students never line up this well, and a fit computed on only six points says nothing about whether the relationship stays linear outside the observed hours, nor whether it would hold up on another group.
c)
Syy−bSxy=573.333−3.6905×155≈1.3095, the residual sum of squares. So se=6−21.3095=0.3274≈0.5722 point.
d)
The point prediction is y^=3.6905×6+44.1905≈66.333, and since x0=x the term (x0−x)2 vanishes. The confidence interval for the mean is y^±tsen1=66.333±2.776×0.5722×0.4082≈66.333±0.648, that is [65.685,66.982]. The prediction interval is y^±tse1+n1=66.333±2.776×0.5722×1.0801≈66.333±1.716, that is [64.618,68.049]. The second is almost three times wider because it combines two uncertainties: the one about the position of the line, the only one present in the first, AND the individual spread of students around this line, measured by se. That is the 1 under the square root. A mean can be known very precisely while an individual remains impossible to predict.
e)
The model gives y^=3.6905×20+44.1905≈118, which exceeds the maximum of 100 and therefore makes no sense. Two mistakes add up. First, extrapolation: the data cover the range from 2 to 10 hours, and nothing guarantees that the relationship stays linear beyond it, whereas we would be doubling the observed range. Second, common sense: a mark is bounded, so the relationship must bend and then level off, which a straight line will never do. A regression model is valid only on the domain over which it was fitted, and a coefficient of determination of 99.8% says strictly nothing about what happens outside it.
Exercise 12: Problem: five claims to check
Each of the following five claims is false or misleading. Explain precisely why, backing each answer with a calculation or a counterexample.
a) “The correlation coefficient is 0.9: so 90% of the variation in y is explained by x.”
b) “The 95% confidence interval obtained is [12,18]: so the true mean has a 95% chance of lying between 12 and 18.”
c) “The p-value is 0.03: so there is only a 3% chance that the null hypothesis is true.”
d) “Our poll covers 1000 people in Quebec and 1000 in Estonia. The Quebec result is less reliable, because Quebec has more inhabitants.”
e) “The test does not reject H0: so the two treatments are equivalent.”
Show the solution
Answers
a)False: r2=0.81, that is 81% and not 90%.
b)False: the true mean is a fixed number. It is the procedure that captures the parameter 95 times out of 100.
c)False: the p-value is P(data∣H0), not P(H0∣data).
d)False: the margin is about 3.1 points in both countries, because it depends on n and not on the population.
e)False: not rejecting does not prove equivalence. Say “these data do not allow us to conclude that there is a difference.”
a)
False: it is the coefficient of DETERMINATION that is interpreted as a percentage of variation explained, and it equals r2=0.92=0.81, that is 81% and not 90%. The confusion is all the more stubborn as the two numbers are close when r is high, but it becomes glaring elsewhere: for r=0.5, only 25% of the variation is explained, not half.
b)
False as stated. In the classical approach, the true mean is a fixed, unknown number: it is either in the interval or it is not, and there is no probability to assign to it. What is worth 95% is the reliability of the PROCEDURE: if the sampling were repeated a large number of times and such an interval built each time, 95% of them would contain the true mean. The correct wording is about the method, not about the particular interval in front of you.
c)
False, and it is the same inversion of conditional probabilities as in exercise 4. The p-value is the probability of observing data at least as extreme as ours IF H0 were true, that is P(data∣H0). The claim reads it as P(H0∣data), which is an entirely different quantity and which, in the classical framework, does not even make sense since H0 is not a random variable.
d)
False. The margin of error depends on the size of the SAMPLE, not on that of the population, as long as the sample represents less than 5% of the population, which is very much the case here. With n=1000 in both countries, the margin is about 10001.96×0.5≈0.031, that is about 3.1 points, the same in both. This is exactly the point established in exercise 3.
e)
False, and it is the error with the heaviest consequences in the whole course. Not rejecting H0 means that the data do not provide sufficient evidence of a difference, which is not evidence that there is no difference. A test can fail to reject simply because it lacks power: in exercise 7, a real misadjustment of 4 grams went unnoticed nearly two times out of ten. To claim equivalence, you need either a specific equivalence test, or at the very least to show that the confidence interval for the difference lies entirely within a zone judged negligible. The correct wording is always: “these data do not allow us to conclude that there is a difference.”
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 on complete papers calibrated to the real level of the final exam, and on the write-up, which is worth half the marks in inference.