Advanced Statistics 201-337 • CEGEP, Montreal

Corrected exercises: estimation and hypothesis testing (201-337)

Here are ten corrected exercises on estimation and hypothesis testing for the CEGEP Advanced Statistics course, 201-337, preceded by a list of calculations. The whole chapter rests on a single idea, the central limit theorem: the mean of a sample is itself a random variable, whose spread, the standard error, is n\sqrt{n} times smaller than that of the individual data. That reduction, and nothing else, is what allows a conclusion about an entire population from a few hundred observations. The set covers the confidence interval for a mean and for a proportion, the margin of error and the sample size, Student's t distribution when σ\sigma is unknown, hypothesis tests on a mean and on a proportion, the p-value, type I and type II errors, comparing two means and the chi-square test of independence.

Exercise 0.1 opens the set with eleven direct calculations on estimation and testing, as in textbook drill lists: the standard error of the mean, confidence intervals at 90%, 95% and 99% with σ\sigma known, with Student's tt and for a proportion, the sample size for a fixed margin of error, then the zz and tt statistics of a test on a mean and the zz statistic of a test on a proportion, each with a value to find that is checked as you type it.

By the end, you can interpret a 95% interval correctly, without saying “a 95% chance that μ\mu is inside” (exercise 2), explain why the margin of a poll is almost always three points (exercise 3), write up a complete test in five steps (exercise 6), put p0p_{0} and not p^\hat{p} in the standard error of a test on a proportion (exercise 7), compare two groups through the standard error of the difference, where the variances add up (exercise 8), and test whether passing and attendance are independent in a contingency table (exercise 9).

Exercise 4 holds the most instructive case of the chapter: a p-value of 0.0114 leads to REJECTING the hypothesis at the 5% level and to NOT REJECTING it at the 1% level. The same data, two opposite conclusions. Understanding why means understanding that a test proves nothing: it arbitrates between two risks chosen in advance. Exercise 10 closes the set on the other misunderstanding: a very large sample makes a difference of no practical importance significant, hence the effect size.

11 corrected exercises • 110 points • 150 minutes

This chapter is part of 201-337, every chapter with its set and sheet Before you start Revision sheet: the traps and the method for this chapter

Self-checking set Type 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.

Course recap

  • • Sampling distribution of the mean: μx‾=μ\mu_{\overline{x}}=\mu and σx‾=σn\sigma_{\overline{x}}=\dfrac{\sigma}{\sqrt{n}}. The latter is called the STANDARD ERROR.
  • • Central limit theorem: for nn large enough, in practice n≥30n\geq 30, the distribution of x‾\overline{x} is approximately NORMAL, whatever the shape of the original population.
  • • Confidence interval for a mean, σ\sigma known: x‾±zα/2σn\overline{x}\pm z_{\alpha/2}\dfrac{\sigma}{\sqrt{n}}. Usual values: z=1.645z=1.645 at 90%, 1.961.96 at 95%, 2.5762.576 at 99%.
  • • Confidence interval for a proportion: p^±zα/2p^(1−p^)n\hat{p}\pm z_{\alpha/2}\sqrt{\dfrac{\hat{p}\left(1-\hat{p}\right)}{n}}.
  • • Margin of error EE: the half-width of the interval. To impose it, invert the formula: n≥(zσE)2n\geq\left(\dfrac{z\sigma}{E}\right)^{2} for a mean, and n≥(z2E)2n\geq\left(\dfrac{z}{2E}\right)^{2} for a proportion in the worst case p^=0.5\hat{p}=0.5.
  • • CORRECT INTERPRETATION of a 95% interval: if the sampling were repeated a large number of times, 95% of the intervals built this way would contain the true parameter. We do NOT say that there is a 95% chance that the parameter lies in THIS particular interval.
  • • Hypothesis test: H0H_{0} is the default hypothesis, H1H_{1} the one we are trying to establish. The P-VALUE is the probability of observing a result at least as extreme IF H0H_{0} is true. Reject H0H_{0} if p-value <α<\alpha.
  • • Type I error: rejecting H0H_{0} when it is true, with probability α\alpha. Type II error: failing to reject H0H_{0} when it is false, with probability β\beta. For a fixed nn, reducing one increases the other.
  • • If σ\sigma is UNKNOWN, it is estimated by ss and x‾−μs/n\frac{\overline{x}-\mu}{s/\sqrt{n}} follows a STUDENT t distribution with n−1n-1 degrees of freedom, more spread out than the normal. Its critical values are therefore always larger than those of zz, and they converge to them as nn grows: that is where the threshold of 30 comes from.
  • • Test on a proportion: z=p^−p0p0(1−p0)/nz=\frac{\hat{p}-p_{0}}{\sqrt{p_{0}(1-p_{0})/n}}, with p0p_{0} IN THE DENOMINATOR because we reason under H0H_{0}. In a confidence interval, p^\hat{p} goes there instead, since there is no starting hypothesis.
  • • Difference of two independent means: σx1‾−x2‾=s12n1+s22n2\sigma_{\overline{x_{1}}-\overline{x_{2}}}=\sqrt{\frac{s_{1}^{2}}{n_{1}}+\frac{s_{2}^{2}}{n_{2}}}. The VARIANCES add up even when the means are subtracted. A 95% interval that excludes zero is always equivalent to a two-sided p-value below 0.05.
  • • Chi-square test of independence: expected count =row total×column totaln=\frac{\text{row total}\times\text{column total}}{n}, statistic χ2=∑(O−E)2E\chi^{2}=\sum\frac{(O-E)^{2}}{E}, degrees of freedom (r−1)(c−1)(r-1)(c-1). Condition: all EXPECTED counts at least 5. The test establishes an association, never causation.

Calculations: intervals and test statistics to compute

Exercise 0.1: Build confidence intervals and compute test statistics: eleven direct calculations

For each line, compute the requested quantity from the summary data given, without stating hypotheses or drawing a conclusion. Table values: z=1.645z=1.645 at 90%, z=1.96z=1.96 at 95% and z=2.576z=2.576 at 99%; Student's tt is given when it is needed. Bounds and statistics to the hundredth, bounds of a proportion to the thousandth, sample sizes as whole numbers.

A single move carries the whole list: compute the STANDARD ERROR first, σn\frac{\sigma}{\sqrt{n}}, sn\frac{s}{\sqrt{n}} or p(1−p)n\sqrt{\frac{p(1-p)}{n}}. For an interval, multiply it by the zz or the tt of the required level and write estimate plus or minus margin; for a test statistic, divide the gap between the estimate and the hypothesized value by it. For a sample size, isolate nn in the margin and always round UP.

  • a) σ=20\sigma=20, n=64n=64: compute the standard error of the mean σx‾\sigma_{\overline{x}}.
  • b) x‾=52\overline{x}=52, σ=10\sigma=10, n=25n=25: build the 95% confidence interval for μ\mu.
  • c) x‾=130\overline{x}=130, σ=24\sigma=24, n=36n=36: build the 90% confidence interval for μ\mu.
  • d) Same data as in c): build the 99% confidence interval for μ\mu.
  • e) x‾=24.5\overline{x}=24.5, s=4s=4, n=16n=16, σ\sigma unknown, t=2.131t=2.131 with 15 degrees of freedom: build the 95% confidence interval for μ\mu.
  • f) 260 successes out of n=400n=400: build the 95% confidence interval for the proportion pp.
  • g) σ=15\sigma=15: what minimum sample size gives a margin of error of 2 on a mean, at 95%?
  • h) Estimated proportion p^=0.30\hat{p}=0.30: what minimum sample size gives a margin of error of 0.050.05, at 95%?
  • i) Test on a mean, μ0=80\mu_{0}=80, x‾=83.2\overline{x}=83.2, σ=12\sigma=12, n=49n=49: compute the zz statistic.
  • j) Test on a mean, μ0=250\mu_{0}=250, x‾=246.4\overline{x}=246.4, s=9s=9, n=36n=36: compute the tt statistic.
  • k) Test on a proportion, p0=0.40p_{0}=0.40, 156 successes out of n=300n=300: compute the zz statistic.

Type your answers, the page tells you right or wrong 0/16

a)
b)
c)
d)
e)
f)
g)
h)
i)
j)
k)
Show the solution

Answers

  • a) σx‾=208=2.5\sigma_{\overline{x}}=\frac{20}{8}=2.5
  • b) 52±3.9252\pm 3.92; [48.08,55.92][48.08, 55.92]
  • c) 130±6.58130\pm 6.58; [123.42,136.58][123.42, 136.58]
  • d) 130±10.30130\pm 10.30; [119.70,140.30][119.70, 140.30]
  • e) 24.5±2.13124.5\pm 2.131; [22.37,26.63][22.37, 26.63]
  • f) 0.65±0.04670.65\pm 0.0467; [0.603,0.697][0.603, 0.697]
  • g) n≥216.09n\geq 216.09; n=217n=217
  • h) n≥322.69n\geq 322.69; n=323n=323
  • i) z=3.212/7≈1.87z=\frac{3.2}{12/7}\approx 1.87
  • j) t=−3.61.5=−2.4t=\frac{-3.6}{1.5}=-2.4
  • k) z=0.120.0008≈4.24z=\frac{0.12}{\sqrt{0.0008}}\approx 4.24

The move that decides everything: the standard error is computed ON ITS OWN, on a separate line, before any margin or statistic. It is what carries the n\sqrt{n} that people forget, and in a test on a proportion it is what takes p0p_{0} and not p^\hat{p}.

a)

σx‾=σn=2064=208=2.5\sigma_{\overline{x}}=\frac{\sigma}{\sqrt{n}}=\frac{20}{\sqrt{64}}=\frac{20}{8}=2.5. Pitfall: dividing by nn instead of n\sqrt{n}, which gives 0.31250.3125.

b)

Standard error 1025=2\frac{10}{\sqrt{25}}=2, margin 1.96×2=3.921.96\times 2=3.92, so 52±3.9252\pm 3.92: the interval is [48.08,55.92][48.08, 55.92].

c)

Standard error 2436=4\frac{24}{\sqrt{36}}=4, margin 1.645×4=6.581.645\times 4=6.58, so 130±6.58130\pm 6.58: the interval is [123.42,136.58][123.42, 136.58]. Pitfall: taking 1.961.96, the 95% value, out of habit.

d)

Same standard error 44, margin 2.576×4=10.3042.576\times 4=10.304, so 130±10.30130\pm 10.30: the interval is [119.70,140.30][119.70, 140.30]. It is wider than the one in c): more confidence is paid for in precision.

e)

σ\sigma is unknown, so we use ss and Student's tt. Standard error 416=1\frac{4}{\sqrt{16}}=1, margin 2.131×1=2.1312.131\times 1=2.131, so 24.5±2.13124.5\pm 2.131: the interval is [22.37,26.63][22.37, 26.63]. Pitfall: taking z=1.96z=1.96, which gives an interval that is too narrow.

f)

p^=260400=0.65\hat{p}=\frac{260}{400}=0.65. Standard error 0.65×0.35400=0.00056875≈0.02385\sqrt{\frac{0.65\times 0.35}{400}}=\sqrt{0.00056875}\approx 0.02385, margin 1.96×0.02385≈0.04671.96\times 0.02385\approx 0.0467, so 0.65±0.04670.65\pm 0.0467: the interval is [0.603,0.697][0.603, 0.697].

g)

We require 1.96×15n≤21.96\times\frac{15}{\sqrt{n}}\leq 2, so n≥1.96×152=14.7\sqrt{n}\geq\frac{1.96\times 15}{2}=14.7 and n≥14.72=216.09n\geq 14.7^{2}=216.09. Round up: n=217n=217. Pitfall: rounding to the nearest integer, 216216, which gives a margin slightly above 2.

h)

We require 1.960.30×0.70n≤0.051.96\sqrt{\frac{0.30\times 0.70}{n}}\leq 0.05, so n≥1.962×0.210.052=3.8416×0.210.0025=322.69n\geq\frac{1.96^{2}\times 0.21}{0.05^{2}}=\frac{3.8416\times 0.21}{0.0025}=322.69. Round up: n=323n=323.

i)

Standard error 1249=127≈1.7143\frac{12}{\sqrt{49}}=\frac{12}{7}\approx 1.7143, so z=83.2−801.7143=3.21.7143≈1.87z=\frac{83.2-80}{1.7143}=\frac{3.2}{1.7143}\approx 1.87.

j)

Standard error 936=1.5\frac{9}{\sqrt{36}}=1.5, so t=246.4−2501.5=−3.61.5=−2.4t=\frac{246.4-250}{1.5}=\frac{-3.6}{1.5}=-2.4. The sign matters: the observed mean is below μ0\mu_{0}. Pitfall: writing μ0−x‾\mu_{0}-\overline{x} in the numerator, which gives +2.4+2.4.

k)

p^=156300=0.52\hat{p}=\frac{156}{300}=0.52. Standard error UNDER H0H_{0}: 0.40×0.60300=0.0008≈0.02828\sqrt{\frac{0.40\times 0.60}{300}}=\sqrt{0.0008}\approx 0.02828, so z=0.52−0.400.02828≈4.24z=\frac{0.52-0.40}{0.02828}\approx 4.24. Pitfall: computing the standard error with p^=0.52\hat{p}=0.52, which gives 4.164.16.

Check: an interval is always centred on the estimate, so the average of the two bounds gives back x‾\overline{x} or p^\hat{p}. For a sample size, substitute the value found for nn and check that the margin falls just under the target: in g), 1.96×15217≈1.9961.96\times\frac{15}{\sqrt{217}}\approx 1.996.

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: sampling, intervals and the logic of a test (/50)

Exercise 1: The central limit theorem and the standard error

The mean of a sample varies from one sample to the next. Its own distribution is much tighter than that of the data, and it is this tightening that makes inference possible.

The results of a national exam have a mean μ=70\mu=70 and a standard deviation σ=12\sigma=12. A random sample of 36 exam papers is drawn.

  • a) Give the mean and the standard error of the distribution of x‾\overline{x}.
  • b) State the central limit theorem and explain why it applies here even if the individual results are not normally distributed.
  • c) Compute the probability that the sample mean exceeds 73.
  • d) The sample size is multiplied by four, to 144 papers. What happens to the standard error?
  • e) To divide the standard error by 10, by how much must the sample size be multiplied? What is the practical consequence?

Type your answers, the page tells you right or wrong 0/11

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) μx‾=70\mu_{\overline{x}}=70 and σx‾=126=2.0\sigma_{\overline{x}}=\dfrac{12}{6}=2.0.
  • b) For n≥30n\geq 30, x‾\overline{x} is approximately normal whatever the shape of the population. Here n=36n=36.
  • c) z=1.50z=1.50, so P≈0.0668P\approx 0.0668. For a single paper, z=0.25z=0.25 and the probability rises to 40%.
  • d) σx‾=1.0\sigma_{\overline{x}}=1.0: multiplying nn by four divides the standard error by 2, not by 4.
  • e) nn must be multiplied by 100. Doubling the precision therefore roughly quadruples the budget.
a)

The mean of the sampling distribution is that of the population: μx‾=70\mu_{\overline{x}}=70. The standard error is σx‾=σn=1236=126=2.0\sigma_{\overline{x}}=\dfrac{\sigma}{\sqrt{n}}=\dfrac{12}{\sqrt{36}}=\dfrac{12}{6}=2.0. Sample means are therefore six times less spread out than individual papers.

b)

The central limit theorem states that for nn large enough, the distribution of x‾\overline{x} is approximately NORMAL, with mean μ\mu and standard deviation σn\dfrac{\sigma}{\sqrt{n}}, WHATEVER the shape of the population distribution. Here n=36≥30n=36\geq 30: the usual practical threshold is reached. That is precisely the strength of the theorem: no assumption at all is needed about the distribution of the individual results, which may be skewed, bimodal or truncated.

c)

z=73−702.0=1.50z=\dfrac{73-70}{2.0}=1.50. The table gives 0.9332 to the left, so P(x‾>73)=1−0.9332=0.0668P\left(\overline{x}>73\right)=1-0.9332=0.0668, about 6.7%. Note that a SINGLE paper above 73 would be far more common: z=73−7012=0.25z=\dfrac{73-70}{12}=0.25, that is 40%. The distinction between the standard deviation of the data and the standard error of the mean is the number one source of errors in the chapter.

d)

σx‾=12144=1212=1.0\sigma_{\overline{x}}=\dfrac{12}{\sqrt{144}}=\dfrac{12}{12}=1.0. Multiplying nn by four has therefore DIVIDED the standard error BY TWO, not by four, because it is n\sqrt{n} and not nn that appears in the denominator.

e)

nn must be multiplied by 102=10010^{2}=100. Going from 36 to 3600 papers only reduces the standard error by a factor of 10. The practical consequence is decisive: the precision of a poll improves very slowly with cost. Doubling the precision requires FOUR TIMES the sample, so roughly four times the budget. That is why almost all opinion polls stop at around 1000 people: beyond that, the gain in precision no longer justifies the expense.

405060708090100means of 36 paperssingle papers: σ = 1273

Exercise 2: The confidence interval for a mean

A point estimate, a single number, says nothing about its own reliability. The confidence interval brackets the unknown parameter and states explicitly the risk that is accepted.

We go back to the sample of 36 papers, whose observed mean is x‾=70\overline{x}=70, with σ=12\sigma=12 known.

  • a) Build the 95% confidence interval for the population mean.
  • b) Build the 99% interval and compare the two widths. Explain what this difference means.
  • c) A student writes: “there is a 95% chance that μ\mu lies between 66.08 and 73.92”. Correct this statement.
  • d) What sample size would give a margin of error of 2 points at 95%?
  • e) Why can a zero margin never be obtained, even with a very large sample?

Type your answers, the page tells you right or wrong 0/12

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) 70±3.9270\pm 3.92, that is [66.08,73.92][66.08, 73.92], of width 7.84.
  • b) 70±5.1570\pm 5.15, that is [64.85,75.15][64.85, 75.15], of width 10.3: more confidence costs precision.
  • c) μ\mu is fixed: it is the INTERVAL that is random. 95% of the intervals built this way would contain μ\mu.
  • d) n≥138.3n\geq 138.3, so n=139n=139 papers, rounded up.
  • e) The margin vanishes only at infinity; on top of it comes the non-sampling error, which the formula does not measure.
a)

x‾±zσn=70±1.96×2.0=70±3.92\overline{x}\pm z\dfrac{\sigma}{\sqrt{n}}=70\pm 1.96\times 2.0=70\pm 3.92. The interval is therefore [66.08,73.92]\left[66.08, 73.92\right], of width 7.84.

b)

At 99%, z=2.576z=2.576, so the margin is 2.576×2.0=5.152.576\times 2.0=5.15 and the interval is [64.85,75.15]\left[64.85, 75.15\right], of width 10.3. The 99% interval is therefore WIDER. This makes sense: demanding more certainty of capturing the true parameter forces us to cast a wider net. There is a permanent trade-off between CONFIDENCE and PRECISION, and both can be improved only by increasing nn.

c)

The statement is incorrect because it treats μ\mu as a random variable. But μ\mu is a FIXED number, though unknown: it is either in the interval or it is not, and there is no probability involved. What is random is the INTERVAL, which changes with every sample. The correct statement is: “if the sampling were repeated a large number of times, 95% of the intervals built this way would contain μ\mu”. In practice this is shortened to “I am 95% confident that μ\mu lies between 66.08 and 73.92”, which is acceptable when speaking but must be justified correctly in a written answer.

d)

We require E=zσn≤2E=z\dfrac{\sigma}{\sqrt{n}}\leq 2, hence n≥1.96×122=11.76\sqrt{n}\geq\dfrac{1.96\times 12}{2}=11.76 and n≥138.3n\geq 138.3. Since nn is an integer and the condition must hold, we ROUND UP: n=139n=139 papers. Rounding to 138 would give a margin slightly above 2, which would break the requirement; it is the only case in the course where rounding is never to the nearest value.

e)

Because the margin E=zσnE=z\dfrac{\sigma}{\sqrt{n}} vanishes only as nn tends to infinity. As long as the sample is a proper subset of the population, an irreducible sampling uncertainty remains. The only way to reach a zero margin would be to survey the ENTIRE population, which is no longer sampling. On top of that, every real survey carries a share of non-sampling error, due to the wording of the questions, to non-response and to selection bias, which the formula does not measure at all and which a very large sample does nothing to improve.

62646668707274767895%: [66.08, 73.92]99%: [64.85, 75.15]

Exercise 3: The confidence interval for a proportion, and the “plus or minus 3%”

The most quoted figure in all of applied statistics is the margin of error of polls. It takes three lines to compute, and the fact that it hardly changes from one poll to the next has a precise explanation.

A poll surveys 1000 people; 540 say they are in favour of a measure.

The figure below represents the situation.

540 in favour46050%01000
  • a) Compute the observed proportion and the 95% confidence interval.
  • b) Give the margin of error in percentage points. Do you recognize this figure?
  • c) Can we claim that the measure has majority support? Justify using the interval.
  • d) What sample size would bring the margin down to 2 points?
  • e) Why is the stated margin almost always about 3 points, whatever the subject of the poll?

Type your answers, the page tells you right or wrong 0/11

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) p^=0.540\hat{p}=0.540, standard error 0.015760.01576, interval [0.509,0.571][0.509, 0.571].
  • b) ±3.1\pm 3.1 points: the famous “plus or minus 3%” of polling firms.
  • c) Yes, but only just: the lower bound 0.509 is above 0.500 by only 0.9 points.
  • d) n≥2401n\geq 2401: the sample must more than double to gain one point.
  • e) nn is almost always close to 1000, and p^(1−p^)\sqrt{\hat{p}(1-\hat{p})} varies little, from 0.500 to 0.458 between p^=0.5\hat{p}=0.5 and p^=0.3\hat{p}=0.3.
a)

p^=5401000=0.540\hat{p}=\dfrac{540}{1000}=0.540. The standard error is 0.540×0.4601000=2.484×10−4=0.01576\sqrt{\dfrac{0.540\times 0.460}{1000}}=\sqrt{2.484\times 10^{-4}}=0.01576. The 95% margin is 1.96×0.01576=0.03091.96\times 0.01576=0.0309. The interval is therefore [0.509,0.571]\left[0.509, 0.571\right].

b)

The margin is 0.0309, that is about ±3.1\pm 3.1 percentage points. This is exactly the “plus or minus 3 points” stated by every polling firm, and we have just recomputed it from scratch.

c)

Yes, but only just. The LOWER bound of the interval, 0.509, is above 0.500: even in the least favourable case compatible with the data at 95%, the measure keeps its majority. The conclusion is therefore supported, but with a margin of only 0.9 points above the decisive threshold. Had the poll given 52% instead of 54%, the interval would have contained 50% and we would have had to conclude that the poll does NOT settle the question, a statement the media almost always get wrong.

d)

In the worst case p^=0.5\hat{p}=0.5, we require 1.960.25n≤0.021.96\sqrt{\dfrac{0.25}{n}}\leq 0.02, hence n≥1.96×0.50.02=49\sqrt{n}\geq\dfrac{1.96\times 0.5}{0.02}=49 and n≥2401n\geq 2401. The sample must therefore more than DOUBLE, from 1000 to 2401 people, to gain barely more than one point of precision.

e)

For two reasons that combine. First, the sample size is almost always chosen around 1000, a figure that comes from the cost-precision trade-off seen in d. Second, the factor p^(1−p^)\sqrt{\hat{p}\left(1-\hat{p}\right)} varies very little: it is 0.500 at its maximum at p^=0.5\hat{p}=0.5, and still 0.458 for p^=0.30\hat{p}=0.30, barely 8% less. The margin is therefore very insensitive to the observed result, and for n=1000n=1000 it always stays close to 1.96×0.51000=0.031\dfrac{1.96\times 0.5}{\sqrt{1000}}=0.031. Polling firms in fact publish the maximum margin, computed at p^=0.5\hat{p}=0.5, which makes it strictly constant for a given sample size.

Exercise 4: The logic of a hypothesis test

A hypothesis test proves nothing: it measures how surprising the data would be if the default hypothesis were true, and compares that surprise with a threshold set IN ADVANCE.

A manufacturer states that its bags weigh 500 g. An inspector weighs 40 bags and finds a mean of 494 g. The standard deviation of the process is known, σ=15\sigma=15 g.

The figure below represents the situation.

488492496500504stated: 500 gmean of 40 bags: 494 g
  • a) State H0H_{0} and H1H_{1}, and justify the choice of a two-sided test.
  • b) Compute the test statistic.
  • c) Compute the p-value and state its exact meaning.
  • d) Draw a conclusion at the 5% level, then at the 1% level. Comment on the difference.
  • e) Define type I and type II errors in this concrete context, and say which one a consumer protection agency will try to minimize.

Type your answers, the page tells you right or wrong 0/13

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) H0:μ=500H_{0}:\mu=500 g against H1:μ≠500H_{1}:\mu\neq 500 g. Two-sided: any labelling gap is a defect.
  • b) Standard error 2.3722.372 g, so z=−2.530z=-2.530.
  • c) p-value =2(0.0057)=0.0114=2(0.0057)=0.0114: the probability of such a gap IF the bags really weighed 500 g.
  • d) Rejected at 5%, not rejected at 1%. The level is set in advance, and the p-value is reported.
  • e) Type I: accusing an honest manufacturer. Type II: letting the deception through. The agency first minimizes type II.
a)

H0:μ=500H_{0}: \mu=500 g, the manufacturer's statement is accurate. H1:μ≠500H_{1}: \mu\neq 500 g. The test is TWO-SIDED because the inspector is checking that the labelling is accurate: a gap in either direction is a defect, a systematic overfilling also being a process anomaly. Had the mandate been to detect only fraud at the consumer's expense, we would have set H1:μ<500H_{1}: \mu<500 and run a one-sided test.

b)

The standard error is σn=1540=2.372\dfrac{\sigma}{\sqrt{n}}=\dfrac{15}{\sqrt{40}}=2.372 g. The statistic is z=494−5002.372=−2.530z=\dfrac{494-500}{2.372}=-2.530.

c)

Since the test is two-sided, the p-value is 2×P(Z<−2.530)=2×0.0057=0.01142\times P\left(Z<-2.530\right)=2\times 0.0057=0.0114. Exact meaning: IF the bags really weighed 500 g on average, then a sample of 40 bags differing from that value by at least 6 g, in either direction, would occur in only 1.14% of cases. The p-value is NOT the probability that H0H_{0} is true, a confusion that is the most widespread misinterpretation in statistics.

d)

At the level α=0.05\alpha=0.05: 0.0114<0.050.0114<0.05, we REJECT H0H_{0} and conclude that the mean weight differs from 500 g. At the level α=0.01\alpha=0.01: 0.0114>0.010.0114>0.01, we do NOT reject H0H_{0}, for lack of sufficient evidence. The same data therefore lead to two opposite conclusions. There is no contradiction here: the significance level expresses the risk of a type I error we are willing to accept, and it is a decision made in advance, according to the consequences. This case shows why the p-value itself must ALWAYS be reported rather than the bare word “significant”, and why setting the level after seeing the data is a serious methodological fault.

e)

TYPE I error: concluding that the bags do not weigh 500 g when they actually do, so wrongly accusing an honest manufacturer. TYPE II error: concluding that nothing is wrong when the bags are actually underfilled, so letting a deception go through. A consumer protection agency will first try to minimize the TYPE II error, the one that lets fraud go unpunished, even if it means accepting a higher α\alpha. A court, bound by the presumption of innocence, would make the opposite trade-off. For a fixed nn, reducing one automatically increases the other: the only way to reduce both at once is to INCREASE the sample.

−1.9601.96−2.5762.576z = −2.53H₀ not rejected2.5%

Exercise 5: Student's t distribution: when the population standard deviation is unknown

Until now, σ\sigma was given. In reality it almost never is: it is estimated by the sample standard deviation ss, and that estimate comes at a price. A laboratory measures the content of a product 12 times and obtains x‾=48.6\overline{x}=48.6 mg and s=3.2s=3.2 mg. Useful critical values: t0.025=2.201t_{0.025}=2.201 for 11 degrees of freedom and t0.025=2.045t_{0.025}=2.045 for 29.

  • a) Why can the z-score not be used here? What is the distribution of x‾−μs/n\frac{\overline{x}-\mu}{s/\sqrt{n}}, and how many degrees of freedom does it have?
  • b) Build the 95% confidence interval for the true mean content of the product.
  • c) Compute the interval that would have been obtained by wrongly using z=1.96z=1.96. By what percentage is the correct interval wider, and why must the gap go in this direction?
  • d) The laboratory raises its sample to 30 measurements, with the same x‾\overline{x} and ss. Recompute the gap between the Student approach and the normal approach. What practical rule do you draw from it, and why is the threshold of 30 seen everywhere?
  • e) What condition must the population satisfy for this calculation to be valid on only 12 measurements? What should be done if it clearly does not?

Type your answers, the page tells you right or wrong 0/15

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) The z-score requires σ\sigma known. Here, Student's t distribution with n−1=11n-1=11 degrees of freedom, more spread out than the normal.
  • b) 48.6±2.0348.6\pm 2.03, that is about [46.6,50.6][46.6, 50.6] mg.
  • c) With zz: ±1.81\pm 1.81 mg. The correct interval is 12% wider, because t>zt>z always.
  • d) At 29 degrees of freedom, the gap drops to 4%. Hence the threshold of 30, a convention of convenience.
  • e) The population must be normal. Otherwise: plot the data, transform the variable, or switch to a nonparametric method.
a)

Because the z-score assumes σ\sigma is KNOWN. Replacing it by ss brings in a second source of variability: from one sample to the next, not only does x‾\overline{x} change, but ss changes too, and an ss that is too small would produce a misleadingly narrow interval. The ratio x‾−μs/n\frac{\overline{x}-\mu}{s/\sqrt{n}} therefore does not follow a normal distribution but a STUDENT t distribution with n−1=11n-1=11 degrees of freedom, more spread out than the normal, with heavier tails. One degree of freedom is lost because ss was computed from x‾\overline{x}, itself drawn from the same data.

b)

Standard error: sn=3.212≈0.924\frac{s}{\sqrt{n}}=\frac{3.2}{\sqrt{12}}\approx 0.924 mg. Margin: (2.201)(0.924)≈2.03(2.201)(0.924)\approx 2.03 mg. Interval: 48.6±2.0348.6\pm 2.03, that is about [46.6,50.6][46.6, 50.6] mg.

c)

With z=1.96z=1.96: margin (1.96)(0.924)≈1.81(1.96)(0.924)\approx 1.81 mg, so [46.8,50.4][46.8, 50.4]. The correct interval is wider by the ratio 2.2011.96≈1.12\frac{2.201}{1.96}\approx 1.12, that is about 12% more. The gap must go in this direction: Student's t distribution is MORE SPREAD OUT than the normal, so its critical values are always larger. Using z when σ\sigma is unknown amounts to claiming a precision you do not have, and therefore to being wrong more often than the stated confidence level suggests.

d)

With 29 degrees of freedom, t0.025=2.045t_{0.025}=2.045 against z=1.96z=1.96: the ratio drops to 2.0451.96≈1.043\frac{2.045}{1.96}\approx 1.043, a gap of only 4%, against 12% with 12 measurements. Student's t distribution CONVERGES to the normal as the number of degrees of freedom grows, because ss then estimates σ\sigma better and better. That is where the threshold of 30, found in every textbook, comes from: beyond it, the gap between the two distributions falls below a few percent, negligible compared with the other approximations of a real study. It is not a mathematical threshold but a convention of convenience; today, since software uses Student's t distribution whatever the size, the question only arises on exams.

e)

On such a small sample, validity rests on the NORMALITY of the original population, because the central limit theorem has not had time to act with only 12 data values. In practice, the Student procedure is robust: it copes well with a moderate departure from normality from about fifteen observations on, but it fails with strong skewness or with outliers. The reflex is therefore to PLOT the data before computing, with a box plot or a histogram. If the distribution is clearly skewed, two routes are open: transform the variable, for example by taking its logarithm, or turn to a nonparametric method, which assumes no shape for the distribution.

Part B: exam level (/50)

Exercise 6: A complete test, from the hypotheses to the write-up

On an exam, half of the marks for a test go to the WRITE-UP: stating the hypotheses, announcing the significance level, computing, deciding, and concluding in the words of the problem. The five steps always come in the same order.

A company claims that the mean waiting time at its telephone service does not exceed 4.0 minutes. A consumer association times 50 calls and obtains a mean of 4.4 minutes, with σ=1.5\sigma=1.5 minutes.

The figure below represents the situation.

33.23.43.63.84.24.44.64.85claimed: 4.0 at most50 calls: 4.4 min4
  • a) State the five steps of a hypothesis test.
  • b) State H0H_{0} and H1H_{1} and justify that the test is right-tailed.
  • c) Carry out the complete test at the 5% level and write the conclusion.
  • d) Would the conclusion change with a two-sided test? Compute and comment.
  • e) The association has the budget for 200 calls instead of 50. Without redoing the whole calculation, explain how this would change the power of the test.

Type your answers, the page tells you right or wrong 0/15

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) 1: hypotheses. 2: level and conditions. 3: statistic. 4: p-value and decision. 5: conclusion in plain language.
  • b) H0:μ≤4.0H_{0}:\mu\leq 4.0 against H1:μ>4.0H_{1}:\mu>4.0. Right-tailed: only a longer wait is a grievance.
  • c) Standard error 0.21210.2121, z=1.886z=1.886, p-value 0.0296<0.050.0296<0.05: reject. The mean wait really exceeds 4.0 minutes.
  • d) Two-sided, p-value =0.0593>0.05=0.0593>0.05: the conclusion is reversed. The direction of the test is set before collecting data.
  • e) Standard error divided by 2, z=3.77z=3.77: the power increases, and it is the only way to reduce both types of error at once.
a)

Step 1: state H0H_{0} and H1H_{1}. Step 2: set the significance level α\alpha and check the conditions. Step 3: compute the test statistic. Step 4: compute the p-value, or compare with the critical value, and decide. Step 5: conclude in plain language, in the words of the problem, without jargon.

b)

H0:μ≤4.0H_{0}: \mu\leq 4.0 minutes, the company's claim is true. H1:μ>4.0H_{1}: \mu>4.0 minutes. The test is RIGHT-TAILED because the association is trying to establish only one thing: that the wait is LONGER than claimed. A waiting time shorter than promised is of no interest to it and would be no grievance. The alternative hypothesis must always reflect what we are trying to show.

c)

Conditions: n=50≥30n=50\geq 30, the central limit theorem applies and σ\sigma is known. The standard error is 1.550=0.2121\dfrac{1.5}{\sqrt{50}}=0.2121 minutes. The statistic is z=4.4−4.00.2121=1.886z=\dfrac{4.4-4.0}{0.2121}=1.886. Since the test is right-tailed, the p-value is P(Z>1.886)=0.0296P\left(Z>1.886\right)=0.0296. As 0.0296<0.050.0296<0.05, we REJECT H0H_{0}. Written conclusion: at the 5% level, the data collected allow us to conclude that the mean waiting time really exceeds the 4.0 minutes claimed by the company; the observed gap of 0.4 minutes is too large to be put down to sampling chance alone.

d)

In a two-sided test, the p-value would double: 2×0.02967=0.05932\times 0.02967=0.0593. As 0.0593>0.050.0593>0.05, we would NOT reject H0H_{0}. The conclusion is therefore reversed. This shows that a one-sided test is more POWERFUL when there is a legitimate reason to orient the hypothesis, since it puts all of the risk α\alpha on one side. But it also shows the danger: choosing a one-sided test AFTER seeing the direction of the gap amounts to quietly doubling your significance level, which is a methodological fault. The direction of the test must be set before the data are collected.

e)

The power, that is 1−β1-\beta, the probability of detecting a gap that is really there, would INCREASE. Going from 50 to 200 calls divides the standard error by 4=2\sqrt{4}=2, down to 0.106 minutes. The same observed gap of 0.4 minutes would then produce a statistic twice as large, z=3.77z=3.77, and therefore a much smaller p-value. In other words, with 200 calls the association would detect SMALLER gaps than those it can establish with 50, and its conclusion would hold up whatever the significance level and whether the test is one-sided or two-sided. Increasing nn is the only way to reduce both types of error at once.

Exercise 7: The test on a proportion

A manufacturer claims that 90% of its parts conform to specifications. A customer inspects 200 of them and finds only 172 that conform. The customer suspects the manufacturer of overstating its quality.

The figure below represents the situation.

172 conforming2890%0200
  • a) Compute the observed proportion. State H0H_{0} and H1H_{1}, and justify why the test is one-sided and in which direction.
  • b) Check the conditions of validity, then compute the standard error of the proportion UNDER H0H_{0} and the test statistic.
  • c) Compute the p-value and state precisely what it means here.
  • d) Draw a conclusion at the 5% level, then at the 1% level. What should be made of a difference between the two?
  • e) In the standard error, 0.90 was used and not the observed proportion 0.86. Justify this choice, and say why it is the other way round in a confidence interval.

Type your answers, the page tells you right or wrong 0/15

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) p^=0.860\hat{p}=0.860. H0:p=0.90H_{0}:p=0.90 against H1:p<0.90H_{1}:p<0.90, left-tailed.
  • b) np0=180np_{0}=180 and n(1−p0)=20n(1-p_{0})=20, both ≥5\geq 5. Standard error 0.02120.0212, so z≈−1.89z\approx -1.89.
  • c) p-value ≈0.0297\approx 0.0297: the probability of a result this unfavourable IF pp really were 0.90.
  • d) Rejected at 5%, not rejected at 1%: the evidence is moderate, so report the p-value rather than a verdict.
  • e) The test assumes H0H_{0} is true, so p0=0.90p_{0}=0.90. The interval has no starting hypothesis, so p^=0.86\hat{p}=0.86, hence a standard error of 0.02450.0245.
a)

p^=172200=0.860\hat{p}=\frac{172}{200}=0.860. Hypotheses: H0:p=0.90H_{0}:p=0.90, the manufacturer's claim, which is the default hypothesis, rejected only on evidence; and H1:p<0.90H_{1}:p<0.90. The test is LEFT-TAILED because the customer is only worried about a quality BELOW the claim: a proportion above 90% would be no ground for a dispute. The direction of H1H_{1} must be set before looking at the data, otherwise the significance level loses all meaning.

b)

Conditions: np0=(200)(0.90)=180≥5np_{0}=(200)(0.90)=180\geq 5 and n(1−p0)=(200)(0.10)=20≥5n(1-p_{0})=(200)(0.10)=20\geq 5, so the normal approximation is legitimate. Standard error under H0H_{0}: σp^=p0(1−p0)n=(0.90)(0.10)200=0.00045≈0.0212\sigma_{\hat{p}}=\sqrt{\frac{p_{0}(1-p_{0})}{n}}=\sqrt{\frac{(0.90)(0.10)}{200}}=\sqrt{0.00045}\approx 0.0212. Test statistic: z=p^−p0σp^=0.860−0.9000.0212≈−1.89z=\frac{\hat{p}-p_{0}}{\sigma_{\hat{p}}}=\frac{0.860-0.900}{0.0212}\approx -1.89.

c)

Left-tailed test: p-value =P(Z<−1.886)≈0.0297=P(Z<-1.886)\approx 0.0297, about 3.0%, keeping zz unrounded; the table, read at z=−1.89z=-1.89, gives 0.02940.0294, which changes nothing in what follows. Exact meaning: IF the manufacturer were telling the truth, that is, if the true proportion really were 0.90, then a sample of 200 parts would give a result this unfavourable or worse in 3% of cases. It is NOT the probability that the manufacturer is wrong: the p-value is computed assuming H0H_{0} is true, so it can say nothing about the probability of H0H_{0}.

d)

At the 5% level: 0.0297<0.050.0297<0.05, we REJECT H0H_{0}, the data are significantly below the claim. At the 1% level: 0.0297>0.010.0297>0.01, we do NOT reject. Such a difference is not a contradiction: it simply signals that the evidence is moderate, and that the conclusion depends on the standard of proof chosen. Good practice is to report the p-value itself rather than a yes-or-no verdict, so that readers can judge with their own level. It is also a reminder that the level must be set BEFORE the calculation: choosing it afterwards amounts to choosing the conclusion.

e)

In a TEST, we reason assuming H0H_{0} is true from start to finish: it is this hypothesis that supplies the value of pp to use, hence 0.90. Using 0.86 would partly assume the very thing we are putting to the test. In a confidence INTERVAL, on the other hand, there is no starting hypothesis: we have only the sample, and the only value available to estimate the standard error is p^\hat{p}. The two procedures do not start from the same place, hence two formulas that look alike without being identical, and a very common confusion on exams.

Exercise 8: Comparing two means: the two-sample test

Two groups take the same course with different teaching methods. Group 1: 40 students, mean 74.2 and standard deviation 8.5. Group 2: 35 students, mean 70.1 and standard deviation 9.2. The two samples are independent and both sizes exceed 30.

The chart below represents the data.

5565758595group 1: 74.2 ± 8.5 (n = 40)group 2: 70.1 ± 9.2 (n = 35)
  • a) State H0H_{0} and H1H_{1} to find out whether the two methods differ, and justify the two-sided choice.
  • b) Compute the standard error of the DIFFERENCE of the means. Why are the two terms added when the means are subtracted?
  • c) Compute the test statistic and the p-value.
  • d) Draw a conclusion at the 5% and 1% levels.
  • e) Build the 95% confidence interval for the difference μ1−μ2\mu_{1}-\mu_{2}. Check that it agrees with the test, and say what the interval adds to the p-value.

Type your answers, the page tells you right or wrong 0/16

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) H0:μ1=μ2H_{0}:\mu_{1}=\mu_{2} against H1:μ1≠μ2H_{1}:\mu_{1}\neq\mu_{2}, two-sided.
  • b) 1.806+2.418≈2.055\sqrt{1.806+2.418}\approx 2.055: the variances add up, even for a difference.
  • c) z=4.12.055≈1.99z=\dfrac{4.1}{2.055}\approx 1.99, p-value ≈0.046\approx 0.046.
  • d) Rejected only just at 5%, not rejected at 1%: a clue, not a proof.
  • e) 4.1±4.034.1\pm 4.03, that is [0.07,8.13][0.07, 8.13]: it only just excludes zero, and gives the order of magnitude of the effect, from negligible to large.
a)

H0:μ1=μ2H_{0}:\mu_{1}=\mu_{2}, that is μ1−μ2=0\mu_{1}-\mu_{2}=0: the two methods give the same mean result. H1:μ1≠μ2H_{1}:\mu_{1}\neq\mu_{2}. The test is TWO-SIDED because the question asked is whether the methods DIFFER, without having decided in advance which one would be better. Choosing a one-sided test after noticing that group 1 has the higher mean would be a fault: it would amount to halving the p-value in light of the data.

b)

σx1‾−x2‾=s12n1+s22n2=72.2540+84.6435=1.806+2.418=4.225≈2.055\sigma_{\overline{x_{1}}-\overline{x_{2}}}=\sqrt{\frac{s_{1}^{2}}{n_{1}}+\frac{s_{2}^{2}}{n_{2}}}=\sqrt{\frac{72.25}{40}+\frac{84.64}{35}}=\sqrt{1.806+2.418}=\sqrt{4.225}\approx 2.055. We add because it is the VARIANCES that add up for independent variables, whether these variables are added or subtracted. The intuition is simple: subtracting two uncertain quantities does not remove the uncertainty, it accumulates it, each of the two means contributing to the variation of the difference. The standard deviation of the difference is larger than each of the two taken separately, never smaller.

c)

z=(74.2−70.1)−02.055=4.12.055≈1.99z=\frac{(74.2-70.1)-0}{2.055}=\frac{4.1}{2.055}\approx 1.99. Two-sided test: p-value =2 P(Z>1.99)≈2(0.0230)=0.046=2\,P(Z>1.99)\approx 2(0.0230)=0.046.

d)

At the 5% level: 0.046<0.050.046<0.05, we reject H0H_{0}, but only just. At the 1% level: 0.046>0.010.046>0.01, we do not reject. The result is therefore borderline: it is a clue, not a proof, and it calls for a replication on a larger sample rather than a firm conclusion. Announcing “method 1 is better” on this basis would go far beyond what the data allow.

e)

Interval: (74.2−70.1)±(1.96)(2.055)=4.1±4.03(74.2-70.1)\pm(1.96)(2.055)=4.1\pm 4.03, that is about [0.07,8.13][0.07, 8.13]. It excludes zero, only just, which agrees exactly with the narrow rejection at the 5% level: the two procedures are two readings of the same calculation, and a 95% interval that excludes zero is always equivalent to a p-value below 0.05 in a two-sided test. The interval nevertheless adds a great deal: it does not only say that a difference exists, it gives the set of plausible values of that difference, here between almost nothing and eight points. In other words, the data are compatible with a negligible effect as well as with a large one, which the bare statement “significant at 5%” would completely hide.

Exercise 9: The chi-square test of independence

We want to know whether passing a course is related to regular attendance. Out of 200 students: among the 120 who attend regularly, 90 passed and 30 failed; among the 80 who do not, 40 passed and 40 failed. Critical values of chi-square with 1 degree of freedom: 3.841 at the 5% level and 6.635 at the 1% level.

The chart below represents the data.

90 passed30 failedregular40 passed40 failedirregular
  • a) Draw up the contingency table with its totals, compute the pass rates of the two groups, and state H0H_{0} and H1H_{1}.
  • b) Compute the EXPECTED counts under H0H_{0} and justify the formula used.
  • c) Compute the chi-square statistic and its number of degrees of freedom.
  • d) Draw a conclusion at the 5% and 1% levels. Check the conditions of validity of the test along the way.
  • e) Can we deduce that attending class makes students pass? Discuss, and suggest a competing explanation.

Type your answers, the page tells you right or wrong 0/17

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) Totals: 130 passes, 70 failures, 200 students. Rates 75% against 50%. H0H_{0}: independence.
  • b) E=row×column200E=\dfrac{\text{row}\times\text{column}}{200}, that is 78, 42, 52 and 28.
  • c) χ2≈13.19\chi^{2}\approx 13.19 with 1 degree of freedom.
  • d) Rejected at 5% and at 1%. The smallest expected count is 28, well above 5.
  • e) No: association is not causation. Motivation, a confounding variable, would explain both attendance and passing.
a)

The table crosses attendance with passing: regular attenders, 90 passes and 30 failures, total 120; irregular attenders, 40 and 40, total 80. Column totals: 130 passes and 70 failures, for 200 students. Pass rates: 90120=75\frac{90}{120}=75% among regular attenders against 4080=50\frac{40}{80}=50% among the others, a gap of 25 points. H0H_{0}: the two variables are INDEPENDENT, attendance has no link with passing. H1H_{1}: they are related.

b)

Under H0H_{0}, the pass rate must be the same everywhere, namely the overall rate 130200=65\frac{130}{200}=65%. Among regular attenders we therefore expect (120)(0.65)=78(120)(0.65)=78 passes, which can be written (120)(130)200\frac{(120)(130)}{200}: EXPECTED count =row total×column totalgrand total=\frac{\text{row total}\times\text{column total}}{\text{grand total}}. The four expected values are thus 78 and 42 for regular attenders, 52 and 28 for irregular attenders. Check: each row and each column adds back up to its original total, which must always be the case.

c)

χ2=∑(O−E)2E=(90−78)278+(30−42)242+(40−52)252+(40−28)228=1.846+3.429+2.769+5.143≈13.19\chi^{2}=\sum\frac{(O-E)^{2}}{E}=\frac{(90-78)^{2}}{78}+\frac{(30-42)^{2}}{42}+\frac{(40-52)^{2}}{52}+\frac{(40-28)^{2}}{28}=1.846+3.429+2.769+5.143\approx 13.19. The gaps all equal 12 in absolute value, as is always the case in a 2 by 2 table, but they weigh more when the expected count is small, hence the division by EE. Degrees of freedom: (2−1)(2−1)=1(2-1)(2-1)=1, because once one cell is fixed, the totals determine the other three.

d)

13.19>3.84113.19>3.841: we reject H0H_{0} at the 5% level. 13.19>6.63513.19>6.635: we also reject it at the 1% level, and by a wide margin, the p-value being of the order of 0.0003. The conclusion is therefore solid, unlike the borderline case of a narrow rejection. Conditions of validity: all EXPECTED counts must be at least 5; here the smallest is 28, so the condition is easily met. Note that it applies to the expected counts, never to the observed counts.

e)

No. The chi-square test establishes a statistical ASSOCIATION between two variables; it says nothing about the direction of causation, or even whether there is any. Three readings remain possible. Attendance may indeed help students pass, which is plausible. Passing may also feed attendance: a student who understands and succeeds takes a liking to the course and keeps coming, while one who falls behind stops showing up, so that the arrow would go from passing to attendance. Finally, a CONFOUNDING variable may produce both: motivation, personal organization, or simply not working thirty hours a week alongside one's studies, would explain both attendance and results, without either one causing the other. Only an experiment in which attendance was imposed at random could settle the matter, and it would hardly be practicable. It is exactly the same caution as the one a correlation coefficient demands.

Exercise 10: Problem: significant does not mean important

A very large sample makes almost any gap statistically significant, however tiny. Telling SIGNIFICANCE, which is a question of chance, from IMPORTANCE, which is a question of consequences, is the final skill of the course.

We go back to the bags labelled 500 g, with σ=15\sigma=15 g. This time the inspector weighs 10,000 bags and obtains a mean of 499.5 g.

  • a) Carry out the two-sided test at the 5% level and draw a conclusion.
  • b) The observed gap is 0.5 g out of 500. Express it as a percentage and comment on its practical importance.
  • c) Compute the effect size d=∣x‾−μ0∣σd=\dfrac{\left|\overline{x}-\mu_{0}\right|}{\sigma} in this case and in that of exercise 4, where the gap was 6 g on 40 bags. Compare.
  • d) Explain the mechanism: why does a large nn make a negligible gap significant?
  • e) What information must an honest statistical report publish, in addition to the p-value?

Type your answers, the page tells you right or wrong 0/14

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) Standard error 0.150.15 g, z=−3.33z=-3.33, p-value 0.000860.00086: very clear rejection.
  • b) 0.5500=0.1\dfrac{0.5}{500}=0.1%: significant and of no practical importance.
  • c) d=0.033d=0.033 here against d=0.400d=0.400 in exercise 4: twelve times smaller, despite a far more impressive p-value.
  • d) z=dnz=d\sqrt{n}: the factor n\sqrt{n} has no bound, so every nonzero gap ends up significant.
  • e) Effect size, confidence interval, sample size, exact p-value, and the list of all the analyses carried out.
a)

The standard error is 1510 000=0.15\dfrac{15}{\sqrt{10\,000}}=0.15 g. The statistic is z=499.5−5000.15=−3.33z=\dfrac{499.5-500}{0.15}=-3.33, hence a two-sided p-value of 2×0.00043=0.000862\times 0.00043=0.00086. As 0.00086<0.050.00086<0.05 and even <0.01<0.01, we REJECT H0H_{0} very clearly: the gap is highly significant.

b)

The relative gap is 0.5500=0.1\dfrac{0.5}{500}=0.1%. Half a gram on a 500 g bag is completely negligible in practice: it is well below the tolerance of any commercial scale, below the variation due to ambient humidity, and has no effect whatsoever on the consumer. The result is therefore statistically significant AND of no practical importance. The two notions are independent.

c)

Here d=0.515=0.033d=\dfrac{0.5}{15}=0.033. In exercise 4, d=615=0.400d=\dfrac{6}{15}=0.400. The effect size in the present case is therefore TWELVE TIMES smaller, even though its p-value is far more impressive. This makes sense: the effect size does NOT depend on nn, it measures the gap in units of the population standard deviation, whereas the p-value depends heavily on nn. That is precisely why the effect size is the relevant indicator for judging importance.

d)

Because the test statistic can be written z=x‾−μ0σ/n=x‾−μ0σ×nz=\dfrac{\overline{x}-\mu_{0}}{\sigma/\sqrt{n}}=\dfrac{\overline{x}-\mu_{0}}{\sigma}\times\sqrt{n}, that is, the effect size MULTIPLIED by n\sqrt{n}. The factor n\sqrt{n} has no bound: by making the sample large enough, zz can be made as large as we like for any nonzero gap, however tiny. Since no real process is perfectly centred, every gap ends up significant if we measure enough. The question is therefore never “is there a gap”, to which the answer is always yes, but “is the gap large enough to care about”.

e)

At least four items. First, the EFFECT SIZE, the only measure of importance, insensitive to nn. Second, the CONFIDENCE INTERVAL for the gap, which gives both the order of magnitude and its precision, and which contains far more information than a p-value. Third, the SAMPLE SIZE, without which a p-value cannot be interpreted. Fourth, the EXACT p-value, and not a bare “significant” or “p < 0.05”, so that readers can judge with their own level. To these must be added a statement of all the analyses carried out: testing twenty true null hypotheses at the 5% level produces one false positive on average, and publishing only that one is the practice known as p-hacking.

494496498500502504506499.510,000 bags40 bags
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.

What is it about?
I read every request myself, nobody else sees it. No need to write your name or your school.
When your request is dealt with, you hear about it by email and in your space.

By sending, you agree that I read your request to answer it. It is kept with your account, erased with it, and never published: privacy policy.

Previous chapter Continuous random variables and density, 201-337 Next chapter Correlation and linear regression, 201-337

© Ahmed Squalli Houssaini. Exercise set published at www.letuteurscientifique.ca/en/exercices/cegep-337-estimation-hypothesis-tests. Free for personal and classroom use; republishing it elsewhere requires written permission (legal notice).

See also

Looking for a statistics tutor in Montreal?

Get in touch for a first session. Inference is the chapter where method matters more than calculation: five steps that never change, and half of the marks come from the write-up.

Site by Studio Squalli