The chapter assembled. Sections 9.1 through 9.4 supplied the hypotheses, the two error types, the distributions and the decision rule, and this section adds the one remaining piece and then works complete tests. The remaining piece is the tail: when the p-value is drawn it occupies the left tail, the right tail, or is split evenly between both, and the alternative hypothesis is what decides which. A less-than alternative gives a left-tailed test, a greater-than gives a right-tailed one, and a not-equal gives a two-tailed test whose p-value is twice the area beyond the observed statistic. The significance level is chosen before the data are collected, and a common standard when none is given is five percent. The section then works four full tests, one for each of the three distributions, ending each with a conclusion in the words of the problem and an identification of the two error types in context.
Subject: Statistics · 71 slides · symbolic lesson
Open the interactive version of this deck
Title
Statistics · Chapter 9 — Hypothesis Testing with One Sample
The tail, the decision, and complete tests for a mean and a proportion
Objectives
Sections 9.1 to 9.4 handed you the parts of a hypothesis test one at a time: the two hypotheses, the two kinds of error, the distribution to use and the p-value. This section puts them together. It adds the last missing piece, which tail the p-value lives in, and then runs complete tests from the claim to a sentence about the population.
The arithmetic in every test here is one subtraction and one division. What decides whether your answer is right is everything around it: the right parameter, the right distribution, the right tail and the right sentence at the end. Each of those gets its own slides, and every example ends with an interpretation you could read aloud to someone who has never heard of a p-value.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 468-483 — the section this deck covers
Warm-up
Section 9.4 ended with this problem. Work it from what you already know: the Central Limit Theorem gives the curve for the sample mean, and the p-value is the area beyond what you observed.
Discussion prompt
A normal population has standard deviation 1. A claim says the mean is greater than 12. A sample of 36 has mean 12.5. Find the standard error, the z-score of 12.5, and the p-value for the alternative that the mean exceeds 12.
Figure (svg): A normal curve centred at 12 with standard deviation one sixth, drawn for sample means from 11.4 to 12.7. A solid yellow line marks the observed mean 12.5 at the far right edge of the curve, and the sliver of area beyond it is shaded red; an arrow points to it with the label p-value 0.0013.
Keep that picture in mind: a curve centred where the null says, the observed value marked on it, and the area beyond it shaded. Every test in this deck ends up as a picture like this one. What changes from test to test is which curve, and which side gets shaded.
Notice too what the warm-up did not need: a table. Three standard errors is a landmark you already know from the Empirical Rule, where about 99.7 percent of the area lies within three standard deviations. Half of the remaining 0.3 percent is in the right tail, which is the 0.0013 you found.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 468 — Try It 9.9: the book gives the p-value 0.0013
Section
Part 1
Concept
A p-value on its own is just a probability. To turn it into a decision you need a line drawn in advance, and that line is alpha, the significance level. Alpha is the probability of a Type I error you are prepared to accept: the chance of rejecting a null hypothesis that is actually true.
\[ \alpha > p\text{-value} \;\Longrightarrow\; \text{reject } H_0 \]
\[ \alpha \le p\text{-value} \;\Longrightarrow\; \text{do not reject } H_0 \]
When you reject, the sample results are called significant: there is sufficient evidence that the null is an incorrect belief and that the alternative may be correct. When you do not reject, the results are not significant, and there is not sufficient evidence for the alternative.
Notice the careful wording of the second case. Not rejecting does not mean you should believe the null is true. It only means the sample failed to cast serious doubt on it. A test can find evidence against a claim; it can never prove that claim.
After the decision comes the conclusion, and the book insists on it: a thoughtful sentence about the hypotheses in terms of the problem itself, not in terms of the letters H and alpha.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 468-469 — Decision and Conclusion
Notation
This one line is the whole decision. Hover over each piece, because the commonest slips are reversing the inequality and reading the result as a statement about the truth.
Annotate
On: \( \text{reject } H_0 \iff p\text{-value} < \alpha \)
The book's memory device is worth having: if the p-value is low, the null must go; if the p-value is high, the null must fly. Low and high mean below alpha and above alpha, not small and large in some absolute sense. A p-value of 0.03 is low at the 5 percent level and high at the 1 percent level.
One more habit worth forming now: write alpha down at the top of your work before you compute anything else. Every example in this deck states its level in the problem, and the comparison at the end is only honest if that level was in place before the data were examined.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 469 — Example 9.10's memory device
Fill the middle
The book's Example 9.10 asks you to complete the two decision sentences. Type one word into each blank. Then read the finished pair aloud, because these are the sentences every test in this deck ends with.
Fill in the blanks
Reject the null hypothesis when the p-value is less than alpha; then the results of the sample data support the alternative. Do not reject the null when the p-value is greater than alpha.
Why: A p-value below alpha means the data would be rarer than the risk you agreed to take, so the null goes and the data support the alternative. A p-value above alpha means the data are not that rare, so the null stays and the data do not support the alternative.
The book's solution says the results support the alternative when you reject, and do not support it when you do not reject. Neither sentence mentions proving anything, and neither says the null is true. That restraint is deliberate: a hypothesis test weighs evidence, it does not settle facts.
Read the pair once more with a concrete case in mind. If a drug trial gives a p-value of 0.01 at alpha 0.05, the first sentence applies: reject, and the data support the claim that the drug works. If it gives 0.20, the second applies: do not reject, and the data do not support that claim, which is different from showing the drug fails.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 469 — Example 9.10
Worked example
It's a Boy Genetics Labs claim their procedures improve the chances of a boy being born. A test of a single population proportion gives the results below. Interpret them and state a conclusion in simple, non-technical terms.
Everything is supplied, so the work is reading it. First say what each hypothesis claims in words, then compare the two probabilities, then write the sentence a parent could understand.
Read the hypotheses
Why: the null is the ordinary chance of a boy; the alternative is the lab's claim.
\[ H_0: p = 0.50 \qquad H_a: p > 0.50 \]
Read the significance level and the p-value
Why: alpha was set by whoever designed the test.
\[ \alpha = 0.01, \qquad p\text{-value} = 0.025 \]
Compare
Why: the p-value is the larger of the two.
\[ 0.025 > 0.01 \;\Longrightarrow\; \text{do not reject } H_0 \]
Figure (svg): A standard normal curve from minus 3.5 to 3.5. The area beyond z equals 1.96 is shaded blue and labelled p-value 0.025. Inside it, the smaller area beyond 2.33 is shaded red and labelled alpha 0.01. Dashed lines mark 1.96 and 2.33.
In plain words: at the 1 percent level, these results are not strong enough to show that the lab's procedures raise the chance of a boy above one half. A result this lopsided would turn up about 2.5 percent of the time by chance alone, and the lab's critics set the bar at 1 percent.
Notice that the same p-value would have been significant at the 5 percent level. The decision depends on alpha, which is exactly why alpha must be fixed before anyone sees the data.
Check on the z scale
Why: if the statistic is a z-score, a right tail of 0.025 sits at 1.96, short of the 1 percent cutoff 2.33: the same decision.
\[ z_{0.025} = 1.96 < 2.33 = z_{0.01} \]
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 469 — Try It 9.10
Concept
The section opens with four short rules about alpha. Each one prevents a particular way of fooling yourself, so read them as reasons, not just rules.
Why before the data? Suppose you computed a p-value of 0.03 and only then picked alpha. You would be tempted to pick 0.05 and reject. Had the p-value been 0.07 you might have picked 0.10. An alpha chosen afterwards always agrees with the result, so it measures nothing.
\[ \text{level of significance } 1\% \;\Longrightarrow\; \alpha = 0.01 \]
The 5 percent default is a convention, not a law of nature. It says you accept being fooled by chance about one time in twenty when the null is true. Example 9.21 later in this deck uses 0.005, because its Type I error would be far more costly.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 469 — the bullet points that open the section
Prediction
Two analysts both test at alpha 0.05 and both reject the null. One found a p-value of 0.001, the other 0.04. Decide before reading on.
Predict first
Both analysts rejected at the 5 percent level. Which of them should feel more confident in that decision?
Correct: The one with p-value 0.001
Why: Both decisions follow the rule, but the rule throws away information. A p-value of 0.001 means the data would be a one-in-a-thousand event under the null; 0.04 means one in twenty-five, barely past the line. The book says the analyst should have more confidence with the smaller p-value.
The rule turns a continuous measure of evidence into a yes or no. That is useful for acting, but it hides how close the call was. Reporting the p-value alongside the decision lets a reader see the difference between a clear result and a borderline one.
The same holds on the other side of the line, as the next slide shows: a p-value of 0.4 is much safer ground for not rejecting than one of 0.056.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 469 — thinking about the meaning of the p-value
Intuition
The book closes its list of rules with a warning against mindlessly applying them. Here are its four p-values placed on one line, with alpha 0.05 marked.
Figure (svg): A number line of p-values from 0 to 0.45 with alpha 0.05 marked by a dashed yellow line. Left of it a red band labelled reject; right of it a blue band labelled do not reject. Dots mark 0.001 and 0.04 on the reject side and 0.056 and 0.4 on the do-not-reject side; 0.04 and 0.056 sit close to the line, 0.001 and 0.4 far from it.
The rule puts 0.04 and 0.056 on opposite sides, one rejected and one kept. Yet those two samples carry almost the same evidence: they differ by about one and a half hundredths in probability. A small change in the data could move either across the line.
Now compare the far dots. A p-value of 0.001 is a clear rejection and 0.4 is a clear failure to reject; no reasonable change in alpha would flip either one. Those are the decisions you can make with confidence.
\[ 0.001 \ll 0.05 \qquad 0.04 \approx 0.05 \approx 0.056 \qquad 0.4 \gg 0.05 \]
So report three things, not one: the decision at the stated alpha, the p-value itself, and in a borderline case a sentence saying so. The flea-shampoo test in Part 5 is exactly such a case, and the book itself adds a note that its result is not very definitive.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 469 — a data analyst should use judgment rather than mindlessly applying rules
Section
Part 2
Concept
When you draw the p-value, it is the area in the left tail, the right tail, or split evenly between both. That is why tests are called left-tailed, right-tailed or two-tailed. The book calls the alternative hypothesis the key to the test, because it alone decides which.
\[ H_a: \mu < \mu_0 \to \text{left} \qquad H_a: \mu > \mu_0 \to \text{right} \qquad H_a: \mu \ne \mu_0 \to \text{two} \]
Figure (svg): Three standard normal curves side by side. Left panel, alternative mu less than 10: the left tail beyond minus 1.32 is shaded, area 0.0935. Middle panel, alternative mu greater than 1: the right tail beyond 1.15 is shaded, area 0.1243. Right panel, alternative p not equal to 0.5: both tails beyond minus 1.13 and 1.13 are shaded, each 0.1282, total 0.2564.
The reason is what counts as evidence. If the claim is that the mean is less than 10, only small sample means argue for it, so only the left tail counts. If the claim is a difference in either direction, a result far out on either side argues for it, so both tails count.
The pictures use the p-values the book gives in Try Its 9.11, 9.12 and 9.13. A small misprint to notice in Example 9.13: it writes the null as p equal to 50 and calls it a test of a mean. A proportion cannot be 50, so read it as the mean equal to 50; the two-tailed shape is unaffected.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 469-471 — Examples 9.11-9.13 and Figures 9.3-9.5
Worked example
Each Try It gives a pair of hypotheses and a p-value, and asks what type of test it is and what the picture looks like. On the z scale, locate where each tail begins so the picture can be drawn to scale.
The method is the same each time: read the symbol in the alternative, choose the side, and then find the z that leaves the given area on that side. For the two-tailed case the given p-value is the total, so each tail holds half of it.
Try It 9.11: less-than alternative
Why: left-tailed, so the p-value is the area below some negative z.
\[ H_a: \mu < 10, \quad P(Z < -1.32) = 0.0935 \]
Try It 9.12: greater-than alternative
Why: right-tailed, so the area lies above a positive z.
\[ H_a: \mu > 1, \quad P(Z > 1.15) = 0.1243 \]
Try It 9.13: not-equal alternative
Why: two-tailed, so split the p-value evenly between the tails.
\[ \frac{0.2564}{2} = 0.1282 \text{ in each tail} \]
Locate the two-tailed boundaries
Why: a tail of 0.1282 begins about 1.13 from the centre on each side.
\[ P(Z < -1.13) + P(Z > 1.13) = 0.2564 \]
Notice that none of these decisions needed the data. The tail was fixed the moment the alternative was written down, which is the point of this whole part. The data only decide how far out the boundary sits.
Check the two-tailed split
Why: the two halves must add back to the stated p-value.
\[ 0.1282 + 0.1282 = 0.2564 \]
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 470-471 — Try Its 9.11-9.13
Concept
In a two-tailed test, the p-value is the probability of a result at least as far from the null as yours, in either direction. Your observed statistic sits on one side; its mirror image on the other side is just as extreme.
\[ p\text{-value} = P(Z \le -|z|) + P(Z \ge |z|) \]
The normal curve is symmetric, so those two areas are equal. That turns the sum into one area doubled:
\[ p\text{-value} = 2\,P(Z \ge |z|) \]
Take an observed z of 1.80. The area above 1.80 is 0.0359, and the area below minus 1.80 is the same 0.0359.
\[ p\text{-value} = 2(0.0359) = 0.0719 \]
Figure (svg): A standard normal curve with both tails shaded red: below minus 1.80 and above 1.80. Each tail is labelled 0.0359. A yellow line marks the observed z of 1.80 and a dashed line marks its mirror image, minus 1.80.
In context, this means a two-sided claim pays a price: the same data give twice the p-value of a one-sided test pointing the right way. A result of 1.80 would reject at 5 percent as a right-tailed test but not as a two-tailed one. That is fair, because a two-sided claim accepts evidence from both directions and must be correspondingly harder to satisfy.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 470-471 — the p-value split evenly between the two tails
Notation
This formula has three parts, and forgetting any one of them gives a wrong p-value. Hover over each before the next slides use it.
Annotate
On: \( p\text{-value} = 2 \cdot P(Z \ge |z|) \)
For a t statistic the formula is the same with T in place of Z, since the t curve is symmetric too. A quick sense check: a two-tailed p-value can never exceed one, and if your one-tail area is above one half you used the wrong side before doubling.
In practice you will often have the left-tail area rather than the right, because a negative statistic was observed. That is fine: by symmetry, the area below minus two equals the area above two, so double whichever tail lies beyond your statistic. Example 9.22 does exactly this with a statistic of minus 3.42.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 482 — Example 9.22: find the area to the left of the test statistic and then double this area
Sorting
Read only the alternative for each test from this section, and sort it by its tail. The null is the same kind of statement each time, so it cannot tell you anything about direction.
Sort into buckets
Sort each alternative hypothesis by the tail its p-value occupies.
The swim times are the one to slow down on. Faster sounds like more, but faster swimming means less time, so the alternative is less than 16.43 and the test is left-tailed. Always translate the claim into the measured quantity before choosing the symbol.
Every one of these is a full test you will work later in the deck, so you have just fixed the picture for each of them in advance.
Worked example
A test statistic of z equal to 1.80 has been computed. Find the p-value under each of the three possible alternatives, and the decision at alpha 0.05 for each.
This is a deliberately artificial example. It isolates the one thing that changes between the three tests, the tail, while the data stay fixed. Watch how the decision changes even though the evidence does not.
Right-tailed
Why: the area above 1.80.
\[ P(Z > 1.80) = 1 - 0.9641 = 0.0359 < 0.05 \]
Decision, right-tailed
Why: the p-value is below alpha.
\[ \text{reject } H_0 \]
Left-tailed
Why: the area below 1.80: nearly the whole curve.
\[ P(Z < 1.80) = 0.9641 > 0.05 \]
Two-tailed
Why: double the one-tail area beyond 1.80.
\[ 2(0.0359) = 0.0719 > 0.05 \]
So the right-tailed test rejects, and the other two do not. The left-tailed test fails badly because the data point the opposite way from its claim. The two-tailed test fails narrowly, because doubling pushed 0.0359 past the line.
Check that the one-sided areas are complements
Why: the left and right areas at the same point must add to one.
\[ 0.0359 + 0.9641 = 1 \]
Prediction
Go back to Jeffrey's swim times: null mean 16.43 seconds, standard error 0.2066, observed mean 16. Suppose the test had been set up with the alternative that he swims slower, a greater-than alternative.
Predict first
Under a greater-than alternative, what is the p-value for an observed mean of 16 seconds?
Correct: About 0.98
Why: A greater-than alternative counts large means as evidence, so the p-value is the area to the right of 16. Since 16 is below the centre, that is nearly the whole curve: one minus 0.0187, which is 0.9813.
Figure (svg): The normal curve for mean swim times centred at 16.43 seconds with standard error 0.2066. A yellow line marks the observed mean 16. Everything to the right of 16, almost the whole curve, is shaded blue and labelled 0.9813. The thin left tail is labelled 0.0187.
\[ P(\bar X > 16) = 1 - 0.0187 = 0.9813 \]
A p-value above one half is the signature of data pointing away from the alternative. It is not an error in the arithmetic; it is the correct answer to the question that was asked. The sample gives no support at all to slower times. You will meet a real case of this in Try It 9.21.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 471-472 — Example 9.14's numbers, with the alternative reversed
Trap
A two-sided question, but the sample mean came out high, so a first attempt switches to one tail:
\[ H_a: \mu > \mu_0 \]
\[ p = P(Z > 1.80) = 0.0359 \]
Wrong. The claim, not the data, fixes the tail.
The question asked whether the mean differs, so a high result and a low result were both possible evidence. Picking the side that the data happened to land on halves the p-value.
\[ p = 2(0.0359) = 0.0719 \]
It also secretly doubles the Type I error rate. With the tail chosen after the fact, a true null is rejected whenever either tail beyond 1.645 is reached, which happens 10 percent of the time, not 5.
\[ 0.05 + 0.05 = 0.10 \]
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 469 — Ha tells you if the test is left, right, or two-tailed
Error analysis
Here is an attempt at Example 9.17, the brides who are younger than their grooms, where the alternative is that the proportion differs from one half. The final decision happens to be right, but the p-value is wrong.
Annotate
On: \( p\text{-value} = P(P' > 0.53) = 0.2743 > 0.01 \)
The danger is that this error hides when the evidence is weak, as it is here, and bites when the evidence is borderline. A one-tail area of 0.03 doubled is 0.06: reject at 5 percent if you forget, do not reject if you remember.
The cure is the picture. Shade it before computing, and the second tail is impossible to forget because you have already drawn it.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 476-477 — Example 9.17
Section
Part 3
Concept
Every full example in this section follows the same order. The book labels the steps as it goes: set up the hypothesis test, determine the distribution needed, calculate the p-value, draw the graph, compare alpha and the p-value, make a decision, and write the conclusion.
Figure (svg): Six rounded boxes in two rows of three, joined by arrows. Top row: 1 Hypotheses, H0 and Ha from the claim; 2 Distribution, normal, t, or for p prime; 3 Test statistic, z or t from the data. A connector leads down to the bottom row: 4 p-value and picture, the tail comes from Ha; 5 Decision, compare p-value with alpha; 6 Conclusion, in words, name both errors.
The first three boxes are judgement, not arithmetic. Is the claim about a mean or a proportion? Is sigma known? Which way does the alternative point? Get those right and the rest is one formula. Get any of them wrong and every later number is a precise answer to the wrong question.
The last box has two parts. The conclusion is a sentence in the words of the problem. Then, for most examples, the book also names the Type I and Type II errors in context: what it would mean, for these people and this measurement, to reject wrongly or to keep wrongly.
Example 9.20 later uses a four-step version: state the question, plan, compute, conclude. It is the same six steps grouped into fewer boxes, so nothing new has to be learned.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 471-472 — Example 9.14's labelled solution
Concept
For a test about a mean, the random variable is the sample mean. When the population standard deviation sigma is known, the Central Limit Theorem from Chapter 7 gives its distribution, and the population is normal or the sample is large.
\[ \bar X \sim N\left(\mu_0, \frac{\sigma}{\sqrt{n}}\right) \]
Two parts of that line come from different places, and the book stresses it every time. The centre, mu nought, comes from the null hypothesis, not from the data. The spread, sigma over the square root of n, comes from the population and the sample size.
The data contribute exactly one thing: the observed sample mean, which you mark on the curve. Then the p-value is the area beyond it in the direction the alternative points. To use a standard normal table, convert the mark to a z-score first:
\[ z = \frac{\bar x - \mu_0}{\sigma/\sqrt{n}} \]
Why centre on the null? Because the test asks one question: if the null were true, how surprising would this sample be? You can only answer that by assuming the null and seeing where the sample falls.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 471-473 — Example 9.14 and the historical note's test statistic formula
Notation
This is the formula the calculator's Z-Test runs. Each piece has a source, and keeping track of the sources is most of what the formula asks of you.
Annotate
On: \( z = \frac{\bar x - \mu_0}{\sigma / \sqrt{n}} \)
Before computing, predict the sign. If the sample mean is below the null value, z will be negative; if above, positive. A sign that disagrees with your sketch means the subtraction was done the wrong way round, and the tail you shade will be the wrong one.
Read the whole fraction as a sentence: how many standard errors the sample mean sits from the null's value. A z of minus 2 means two standard errors below; whether that is evidence depends only on which tail the alternative points to.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 473 — the historical note: z = (x̄ − μ)/(σ/√n)
Worked example
Jeffrey's mean time for the 25-yard freestyle was 16.43 seconds, with standard deviation 0.8 seconds. With new goggles he swam 15 times, with mean 16 seconds. His father thinks the goggles made him faster. Test at alpha 0.05, assuming normal swim times.
Start with the setup, because the arithmetic is easy and the direction is not. Faster means less time, so the alternative is less than 16.43, and the test is left-tailed. Sigma is given, so the distribution is normal.
Set up the hypotheses
Why: a single mean; faster means a smaller time.
\[ H_0: \mu = 16.43 \qquad H_a: \mu < 16.43 \]
State the distribution
Why: sigma is known, so the sample mean is normal, centred on the null's value.
\[ \bar X \sim N\left(16.43, \frac{0.8}{\sqrt{15}}\right) \]
Compute the standard error
Why: the square root of 15 is 3.873.
\[ \frac{0.8}{\sqrt{15}} = \frac{0.8}{3.873} = 0.2066 \]
Standardise the observed mean
Why: how many standard errors below 16.43 is 16?
\[ z = \frac{16 - 16.43}{0.2066} = \frac{-0.43}{0.2066} = -2.08 \]
Find the left-tail area
Why: the alternative is less-than, so shade left of 16.
\[ p\text{-value} = P(\bar X < 16) = P(Z < -2.08) = 0.0187 \]
Figure (svg): The normal curve for the mean of 15 swim times, centred at 16.43 seconds with standard error 0.2066. A dashed line at 16.43 is labelled mu nought from H0. A yellow line marks the observed mean 16, and the small area to its left is shaded red and labelled p-value 0.0187.
The book interprets it this way: if the null is true, there is a 1.87 percent chance that Jeffrey's mean time over 15 swims would be 16 seconds or less. That is a rare event, so the sample is hard to explain by chance alone.
Check with the table
Why: a standard normal table at z equal to minus 2.08 gives 0.0188, matching the unrounded 0.0187 to rounding.
\[ P(Z < -2.08) = 0.0188 \approx 0.0187 \]
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 471-472 — Example 9.14 and Figure 9.6
Concept
The book asks for an interpretation of every p-value, and it always has the same three parts. Learning the template saves you from the commonest misreadings.
For Jeffrey: if his true mean is 16.43 seconds, there is a 0.0187 probability that 15 swims would average 16 seconds or less. Each part matters. Drop the condition and the sentence becomes false, because the p-value is computed assuming the null.
\[ p\text{-value} = P(\text{result this extreme} \mid H_0 \text{ true}) \]
Notice what the sentence does not say. It does not say there is a 1.87 percent chance the null is true, or a 1.87 percent chance the goggles do nothing. The p-value is a probability about samples, given the null; it is not a probability about the null, given the sample.
The book adds the phrase actual level of significance for the p-value. That is a good name: alpha is the level you would accept, and the p-value is the level your data actually reached.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 471-472 — Example 9.14: interpretation of the p-value
Worked example
With the p-value found, finish Jeffrey's test: compare, decide, conclude in words, and describe both kinds of error for this problem.
The comparison is mechanical. The conclusion is not: it must mention Jeffrey, the 25-yard freestyle, the 16.43 seconds and the significance level. The errors must be written as statements about his real average, not about H nought.
Compare alpha and the p-value
Why: alpha was preset at 0.05.
\[ \alpha = 0.05 > 0.0187 = p\text{-value} \]
Decide
Why: the p-value is below alpha.
\[ \text{reject } H_0: \mu = 16.43 \]
Conclude in words
Why: name the person, the event and the level.
\[ \text{at the 5\% level, Jeffrey's mean time is less than 16.43 s} \]
Type I error
Why: rejecting a true null.
\[ \text{conclude faster, when his mean is really at least 16.43 s} \]
Type II error
Why: keeping a false null.
\[ \text{find no evidence, when his mean really is below 16.43 s} \]
In context: there is sufficient evidence that Jeffrey swims the 25-yard freestyle faster, on average, than 16.43 seconds, so the data support his father's belief about the goggles. Since we rejected, the only error we could have made is the Type I error, and its chance was capped at 5 percent before we began.
Check with the critical value
Why: the historical method: the test statistic lies beyond the 5 percent critical z, so both methods reject.
\[ z = -2.08 < -1.645 \]
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 472-473 — Example 9.14 and the historical note
Picture it
Before calculators, tests compared z-scores rather than probabilities. The critical value is the z that leaves exactly alpha in the tail; the test statistic is the z computed from the data. For Jeffrey both are drawn on one curve below.
Figure (svg): A standard normal curve. The area left of minus 1.645 is shaded yellow and labelled alpha 0.05. The smaller area left of minus 2.08 is shaded red and labelled p-value 0.0187. Dashed lines mark the critical value minus 1.645 and the test statistic minus 2.08.
The critical value for an area of 0.05 to the left is midway between minus 1.65 and minus 1.64 in the table, so it is minus 1.645. The test statistic, minus 2.08, lies further out. A statistic beyond the critical value has a tail inside the alpha region, so its area is smaller than alpha.
\[ -2.08 < -1.645 \iff 0.0187 < 0.05 \]
So the two methods always agree; they are the same comparison made on two different scales. The book notes that comparing probabilities is the common method today, and it has one advantage: the p-value tells you how far past the line you are, which the yes-or-no of the critical value hides.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 473 — Historical Note (Example 9.14) and Figure 9.7
Tweak it
Jeffrey's observed mean of 16 seconds is fixed. What changes with the number of swims is the curve the null predicts. Slide n and watch where 16 sits relative to the curve.
Parameter explorer
The curve is the null distribution of the mean of n swims, centred at 16.43 with standard error 0.8 over the square root of n. Slide n from 2 to 60. Find roughly the smallest n at which the observed mean of 16 seconds falls clearly outside the bulk of the curve.
\[ \sigma_{\bar x} = \frac{0.8}{\sqrt{{n}}} \]
What to notice: the gap between 16 and 16.43 never changes, but the curve shrinks like one over the square root of n. The same gap becomes more convincing as the sample grows.
| swims n | standard error | z | p-value |
|---|---|---|---|
| 5 | 0.358 | −1.20 | 0.1147 |
| 15 | 0.207 | −2.08 | 0.0187 |
| 30 | 0.146 | −2.94 | 0.0016 |
| 60 | 0.103 | −4.16 | 0.00002 |
At five swims the same 0.43-second improvement would not be significant at 5 percent. At fifteen it is. That is why a test's conclusion always has to be read together with its sample size: absence of evidence from five swims is not evidence that the goggles do nothing.
Worked example
Marco's mean throwing distance is 40 yards, with standard deviation 2 yards. His coach changes his grip and records 20 throws, with mean 45 yards. Test at alpha 0.05 whether the grip helps him throw farther, assuming normal distances.
Farther means more yards, so the alternative is greater than 40 and the test is right-tailed. Sigma is given, so the curve is normal. Before computing, notice that 5 yards is two and a half population standard deviations, and the mean of 20 throws varies far less than one throw does.
Set up the hypotheses
Why: farther is a larger mean.
\[ H_0: \mu = 40 \qquad H_a: \mu > 40 \]
Compute the standard error
Why: the square root of 20 is 4.472.
\[ \frac{\sigma}{\sqrt{n}} = \frac{2}{4.472} = 0.4472 \]
Standardise
Why: the gap of 5 yards in standard errors.
\[ z = \frac{45 - 40}{0.4472} = 11.18 \]
Find the right-tail area
Why: beyond eleven standard errors.
\[ p\text{-value} = P(Z > 11.18) \approx 0 \]
Decide
Why: the p-value is far below alpha.
\[ p\text{-value} < 0.05 \;\Longrightarrow\; \text{reject } H_0 \]
Figure (svg): The normal curve for Marco's mean throw over 20 throws, centred at 40 yards with standard error 0.447, drawn from 38 to 46 yards. The curve is a narrow spike around 40. A yellow line far to the right at 45 yards is labelled observed mean 45, z equals 11.18.
In context: at the 5 percent level there is overwhelming evidence that Marco's mean throwing distance with the new grip is more than 40 yards. A Type I error would be crediting the grip when his mean is really still 40; with a p-value this small, that is almost unthinkable.
Check the size of the answer
Why: the Empirical Rule puts virtually no area beyond 3 standard errors, and 11.18 is far beyond that.
\[ 11.18 \gg 3 \;\Longrightarrow\; p\text{-value} \approx 0 \]
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 472-473 — Try It 9.14
Worked example
A coach records the mean bench press of his players as 275 pounds, standard deviation 55. Three players asked 30 teammates for their maximum lift. The values, with frequencies in parentheses, are 205(3), 215(3), 225(1), 241(2), 252(2), 265(2), 275(2), 313(2), 316(5), 338(2), 341(1), 345(2), 368(2) and 385(1).
The book hands this step to a calculator, but it is only a weighted average. Multiply each value by how often it occurs, add the products, and divide by the number of players.
Figure (svg): A dot plot of the thirty bench-press estimates from 205 to 385 pounds, with stacked dots: three at 205 and at 215, five at 316, and so on. A grey dashed line marks the null value 275 and a yellow dashed line just to its right marks the sample mean 286.17.
Count the players
Why: add the frequencies.
\[ 3+3+1+2+2+2+2+2+5+2+1+2+2+1 = 30 \]
Multiply each value by its frequency
Why: the first four products.
\[ 615 + 645 + 225 + 482 = 1967 \]
The middle five products
Why: continue down the list.
\[ 504 + 530 + 550 + 626 + 1580 = 3790 \]
The last five products
Why: the heaviest lifts.
\[ 676 + 341 + 690 + 736 + 385 = 2828 \]
Total and divide
Why: the sum of all thirty lifts over 30.
\[ \bar x = \frac{1967 + 3790 + 2828}{30} = \frac{8585}{30} = 286.17 \]
So the 30 teammates estimate a mean lift of about 286.17 pounds, eleven pounds above the coach's figure. Whether eleven pounds is a real difference or sampling noise is the question the test on the next slide answers.
Check with deviations from 275
Why: the frequency-weighted deviations must total 30 times the gap of 11.17.
\[ \sum f(x - 275) = 335, \quad \frac{335}{30} = 11.17 \]
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 473-474 — Example 9.15
Worked example
Conduct the test at a 2.5 percent level of significance to decide whether the bench press mean is more than 275 pounds, using sigma 55, n of 30 and the sample mean 286.17 just found.
The claim is more than 275, so the test is right-tailed. Sigma is given, so the curve is normal; the book adds always use sigma if you know it. The coach's 275 is the null value and the centre of the curve.
Set up the hypotheses
Why: more than 275 is the claim to be shown.
\[ H_0: \mu = 275 \qquad H_a: \mu > 275 \]
Compute the standard error
Why: the square root of 30 is 5.477.
\[ \frac{55}{\sqrt{30}} = \frac{55}{5.477} = 10.04 \]
Standardise the sample mean
Why: eleven pounds in standard errors.
\[ z = \frac{286.17 - 275}{10.04} = 1.11 \]
Find the right-tail area
Why: the area above 286.17.
\[ p\text{-value} = P(\bar X > 286.17) = 0.1331 \]
Compare and decide
Why: the p-value is larger than alpha.
\[ 0.1331 > 0.025 \;\Longrightarrow\; \text{do not reject } H_0 \]
Figure (svg): The normal curve for the mean of 30 lifts centred at 275 pounds with standard error 10.04. The area right of the observed mean 286.17 is shaded blue and labelled p-value 0.1331. A red dashed line at 294.7 marks the cutoff for alpha 0.025, and the smaller area beyond it is shaded red.
In context: at the 2.5 percent level there is not sufficient evidence that the true mean bench press is more than 275 pounds. A sample mean of 286 or more would happen about 13 times in 100 by chance even if 275 were right. The book prints 0.1323 in two places; that comes from rounding the mean to 286.2 first, and the exact mean gives 0.1331, the calculator's figure.
Check with the critical value
Why: the 2.5 percent right-tail critical z is 1.96, and the statistic falls short of it.
\[ z = 1.11 < 1.96 \]
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 474 — Example 9.15 and Figure 9.8
Estimation
A company's mean working time is 475 minutes a day, standard deviation 45. A manager timed 20 employees: 460(3), 465(2), 470(3), 475(1), 480(6), 485(3) and 490(2). Is the mean more than 475, at a 2.5 percent level? The sample mean is 9510 over 20, which is 475.5. Estimate first.
Predict first
Without a table, roughly how large is the right-tailed p-value for a sample mean of 475.5?
Correct: About 0.5
Why: The standard error is 45 over the square root of 20, about 10 minutes. Half a minute above 475 is a twentieth of a standard error, practically at the centre of the curve, so the area to the right is just under one half.
\[ z = \frac{475.5 - 475}{45/\sqrt{20}} = \frac{0.5}{10.06} = 0.0497 \]
\[ p\text{-value} = P(Z > 0.0497) = 0.4802 > 0.025 \]
Figure (svg): The normal curve for the mean of 20 working days centred at 475 minutes with standard error 10.06. The observed mean 475.5 sits almost exactly at the centre, and the area to its right, labelled 0.4802, is nearly half the curve.
In context: do not reject; there is not sufficient evidence that the company's employees work more than 475 minutes a day on average. A sample mean half a minute above the claim is exactly what you would expect if the claim were true.
The estimate did most of the work. Measuring the gap in standard errors before computing tells you which region of the table you will land in, and it catches a wrong tail at once.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 475 — Try It 9.15
Trap
For Jeffrey's test, a first attempt centres the curve on the data:
\[ \bar X \sim N(16, 0.2066) \]
\[ P(\bar X < 16) = 0.5 \]
Wrong. The centre comes from the null.
The book says it each time: mu equal to 16.43 comes from H nought, not from the data. The sample mean is the point you mark, not the centre.
\[ \bar X \sim N(16.43, 0.2066) \]
\[ P(\bar X < 16) = 0.0187 \]
The giveaway is a p-value of exactly one half. That can only happen when the observation sits at the centre of its own curve, which says you have tested the data against themselves.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 472 — μ = 16.43 comes from H0 and not the data
Intuition
It can feel strange to draw the distribution around a value you are trying to cast doubt on. The picture explains it. Here are the two candidate curves for Jeffrey's test.
Figure (svg): Two normal curves of the same width. A solid blue curve is centred at 16.43, labelled right: centred on the null. A dashed red curve is centred at 16, labelled wrong: centred on the sample mean. A yellow line at 16 runs through the peak of the red curve.
The blue curve answers the test's question: if Jeffrey's true mean were still 16.43, where would the means of 15 swims fall? Mostly between about 16.0 and 16.85. The observed 16 is at the edge of that range, which is what makes it evidence.
The red curve answers a question nobody asked: if the true mean were 16, where would sample means fall? Around 16, of course. The observation sits at its peak for every possible data set, so the red curve could never produce evidence of anything.
\[ \text{test: } P(\text{data} \mid H_0) \qquad \text{not } P(\text{data} \mid \text{data}) \]
This is the same logic as a courtroom from Section 9.1. You assume innocence and ask whether the evidence would be surprising under that assumption. Assuming guilt and finding the evidence unsurprising proves nothing.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 472 — Our assumption is μ = 16.43
Section
Part 4
Concept
Most real problems do not hand you the population standard deviation. When only sample data are given, you estimate sigma by the sample standard deviation s, and the extra uncertainty in that estimate changes the curve from normal to Student's t distribution.
\[ t = \frac{\bar x - \mu_0}{s/\sqrt{n}}, \qquad df = n - 1 \]
The book's tell for a t test, from Example 9.16: read the problem carefully and notice that no population standard deviation is given, only n sample values from a normal population. The data must be roughly normal, especially when n is small.
Figure (svg): Three bell curves centred at zero from minus 4 to 4. The standard normal is solid blue and tallest. The t curve with 9 degrees of freedom, solid yellow, is slightly lower in the middle and slightly higher in the tails. The t curve with 2 degrees of freedom, dashed orange, is lowest in the middle with visibly thick tails.
The t curves look like the normal but with heavier tails. Beyond 3, the normal holds 0.0013 of its area and the t curve with 9 degrees of freedom holds 0.0075, nearly six times as much. So the same statistic gives a larger p-value on the t curve: weaker evidence, because s itself might be off.
As the degrees of freedom grow, s becomes a reliable estimate of sigma and the t curve closes in on the normal. With a handful of observations, the difference is large enough to change decisions.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 475 — Example 9.16: the distribution for the test is t with 9 degrees of freedom
Worked example
Students believe the mean score on the first statistics test is 65. An instructor thinks it is higher. He samples ten students: 65, 65, 70, 67, 66, 63, 63, 68, 72, 71. The book's calculator reports a mean of 67 and s of 3.1972. Compute both by hand.
The standard deviation is the part people skip, so here it is one line at a time: the mean, each deviation from it, the squares, their sum, and finally the division by n minus 1 and the square root.
Figure (svg): A dot plot of the ten scores: two at 63, two at 65, one each at 66, 67, 68, 70, 71 and 72. A grey dashed line marks 65, the null value, and a yellow dashed line marks the sample mean 67.
Add the scores and divide by 10
Why: the sample mean.
\[ \bar x = \frac{670}{10} = 67 \]
Deviations from 67
Why: in the order the scores were listed.
\[ -2, -2, 3, 0, -1, -4, -4, 1, 5, 4 \]
Square them
Why: each squared deviation.
\[ 4, 4, 9, 0, 1, 16, 16, 1, 25, 16 \]
Add the squares
Why: the sum of squared deviations.
\[ \sum (x - \bar x)^2 = 92 \]
Divide by n minus 1 and take the square root
Why: nine degrees of freedom.
\[ s = \sqrt{\frac{92}{9}} = \sqrt{10.222} = 3.1972 \]
So the ten students averaged 67 points, two above the believed 65, with a typical distance from their mean of about 3.2 points. Both numbers agree with the book's calculator output.
Check that the deviations balance
Why: deviations from a mean always add to zero.
\[ -2-2+3+0-1-4-4+1+5+4 = 0 \]
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 475 — Example 9.16
Worked example
Now run the instructor's test at a 5 percent level, with the mean 67 and s of 3.1972 from ten scores, assuming the scores come from a normal distribution.
Higher is the instructor's claim, so the alternative is greater than 65 and the test is right-tailed. No population standard deviation is given, so the statistic is a t with 9 degrees of freedom.
Set up the hypotheses
Why: the believed mean is the null; higher is the claim.
\[ H_0: \mu = 65 \qquad H_a: \mu > 65 \]
Compute the estimated standard error
Why: s over the square root of 10, which is 3.162.
\[ \frac{s}{\sqrt{n}} = \frac{3.1972}{3.162} = 1.0111 \]
Compute the test statistic
Why: two points in estimated standard errors.
\[ t = \frac{67 - 65}{1.0111} = 1.978 \]
Find the right-tail area on the t curve
Why: with n minus 1, which is 9, degrees of freedom.
\[ p\text{-value} = P(T_9 > 1.978) = 0.0396 \]
Compare and decide
Why: the p-value is below alpha.
\[ 0.0396 < 0.05 \;\Longrightarrow\; \text{reject } H_0 \]
Figure (svg): A t curve with 9 degrees of freedom from minus 4 to 4. The area right of 1.978 is shaded red and labelled p-value 0.0396. A yellow dashed line at 1.833 marks the critical value for alpha 0.05, and a grey dashed line at 2.262 marks the critical value for alpha 0.025.
In context: at the 5 percent level, the sample data show sufficient evidence that the mean score on the first statistics test is greater than 65, just as the instructor thinks. A Type I error would be concluding the mean is above 65 when it is really 65.
Check with the critical t
Why: the 5 percent right-tail critical value with 9 degrees of freedom is 1.833, and the statistic clears it.
\[ t = 1.978 > 1.833 \]
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 475-476 — Example 9.16 and Figure 9.9
Edge cases
The instructor's p-value, 0.0396, is not far below 0.05. Push the significance level down and see where the decision breaks.
Discussion prompt
Would the instructor still reject at a 2.5 percent level? At what alpha does the decision switch? And what p-value would a careless analyst have reported by using the normal curve instead of the t curve?
This is the borderline case the book warned about. The data are evidence for a higher mean, but only moderately strong evidence. A careful report gives the p-value, 0.0396, so a reader who would have chosen a stricter alpha can see the result does not meet it.
It also shows why alpha must be preset. Chosen after the fact, the level could be nudged to 5 percent to get a rejection, or to 2.5 percent to avoid one.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 475-476 — Example 9.16
Trap
For the ten test scores, with no sigma given, a first attempt uses the normal curve:
\[ z = \frac{67 - 65}{3.1972/\sqrt{10}} = 1.978 \]
\[ P(Z > 1.978) = 0.0240 \]
Wrong. s is an estimate, not sigma.
The arithmetic of the statistic is the same, but s varies from sample to sample. The t curve with n minus 1 degrees of freedom builds that extra variation into its heavier tails.
\[ P(T_9 > 1.978) = 0.0396 \]
Here both give a rejection at 5 percent, but the normal answer makes the evidence look stronger than it is. At 2.5 percent the two curves would give opposite decisions.
The rule: sigma given, normal; only data given, t.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 475 — Example 9.16: no population standard deviation is given
Worked example
Conductivity was measured for 11 randomly selected pieces of a type of glass: 1.11, 1.07, 1.11, 1.07, 1.12, 1.08, 0.98, 0.98, 1.02, 0.95, 0.95. Is there convincing evidence that the average conductivity is greater than one? Use alpha 0.05 and assume the population is normal.
The book follows a four-step process here: state the question, plan, compute, conclude. In the plan, notice there is no known population standard deviation, so this is a t test with 10 degrees of freedom, right-tailed because the claim is greater than one.
State the question
Why: is the mean conductivity above one?
\[ H_0: \mu \le 1 \qquad H_a: \mu > 1 \]
The sample mean
Why: eleven values add to 11.44.
\[ \bar x = \frac{11.44}{11} = 1.04 \]
The standard deviation
Why: the squared deviations from 1.04 add to 0.0434.
\[ s = \sqrt{\frac{0.0434}{10}} = 0.06588 \]
The test statistic
Why: the square root of 11 is 3.317.
\[ t = \frac{1.04 - 1}{0.06588/3.317} = \frac{0.04}{0.01986} = 2.014 \]
The right-tail area
Why: on the t curve with 10 degrees of freedom.
\[ p\text{-value} = P(T_{10} > 2.014) = 0.036 \]
Figure (svg): Two panels. Left: a dot plot of the eleven conductivity values from 0.95 to 1.12, with a grey dashed line at the null value 1 and a yellow dashed line at the sample mean 1.04. Right: a t curve with 10 degrees of freedom, the area right of 2.014 shaded red and labelled 0.036.
In context: since 0.036 is below 0.05, reject the null. The data support the claim that the average conductivity of this type of glass is greater than one. Notice the data plot shows two clusters, one below and one above 1; with only 11 pieces, the normality assumption the book asks for is doing real work here.
Check with the critical t
Why: the 5 percent critical value with 10 degrees of freedom is 1.812, and 2.014 is beyond it.
\[ t = 2.014 > 1.812 \]
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 481 — Example 9.20
Worked example
The boiling point of a liquid is measured for 15 samples: 205, 206, 206, 202, 199, 194, 197, 198, 198, 201, 201, 202, 207, 211, 205. Is there convincing evidence that the average boiling point is greater than 200? Use alpha 0.10 and assume a normal population.
No sigma, fifteen values, a greater-than claim: a right-tailed t test with 14 degrees of freedom. The generous alpha is set by the problem, so use it rather than the default.
Hypotheses
Why: greater than 200 is the claim.
\[ H_0: \mu = 200 \qquad H_a: \mu > 200 \]
The sample mean
Why: the fifteen values add to 3032.
\[ \bar x = \frac{3032}{15} = 202.13 \]
The standard deviation
Why: the squared deviations add to 287.73, over 14.
\[ s = \sqrt{\frac{287.73}{14}} = \sqrt{20.552} = 4.533 \]
The estimated standard error
Why: the square root of 15 is 3.873.
\[ \frac{4.533}{3.873} = 1.1705 \]
The test statistic
Why: 2.13 degrees in standard errors.
\[ t = \frac{202.13 - 200}{1.1705} = 1.823 \]
The p-value
Why: right tail, 14 degrees of freedom.
\[ P(T_{14} > 1.823) = 0.0449 < 0.10 \]
Figure (svg): A t curve with 14 degrees of freedom from minus 4 to 4. The area beyond the critical value 1.345 is shaded yellow and labelled alpha 0.10. Inside it, the area beyond the test statistic 1.823 is shaded red and labelled p-value 0.0449.
In context: reject the null; at the 10 percent level there is convincing evidence that the liquid's average boiling point is greater than 200 degrees. This result would also pass at 5 percent, but not at 1 percent.
Check with the critical t
Why: the 10 percent right-tail critical value with 14 degrees of freedom is 1.345.
\[ t = 1.823 > 1.345 \]
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 481 — Try It 9.20
Step zero
A stock is believed to grow at 5 dollars per week, with standard deviation 1 dollar. An investor thinks it will not grow as quickly. Ten weekly changes are 4, 3, 2, 3, 1, 7, 2, 1, 1, 2 dollars. Test at 5 percent. Before any arithmetic, decide the distribution.
Discussion prompt
Is this a z test or a t test, and which tail? Then find the p-value and state the conclusion and both errors.
The deciding words are with a standard deviation of 1 dollar, stated as part of the belief before any sampling. A standard deviation computed from the ten changes would be s, which here is 1.84, and would call for t with 9 degrees of freedom. That route gives t of minus 4.13 and a p-value of 0.0013: the same decision, reached on a different curve.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 476 — Try It 9.16
Section
Part 5
Concept
When a problem talks about percentages or counts of successes rather than a mean, the random variable is the sample proportion, written P prime: the number of successes x divided by the sample size n.
\[ p' = \frac{x}{n} \]
If the null is true and the sample is large enough, P prime is approximately normal. Its centre is the null's proportion, and its standard deviation is built from that same null proportion, not from the sample's.
\[ P' \sim N\left(p_0, \sqrt{\frac{p_0 q_0}{n}}\right), \qquad q_0 = 1 - p_0 \]
Large enough means both n times p nought and n times q nought are at least 5, so that the binomial count behind P prime has a roughly bell-shaped distribution. Example 9.21 checks this explicitly, and so should you, especially for rare events or small samples.
\[ z = \frac{p' - p_0}{\sqrt{p_0 q_0 / n}} \]
Everything else is exactly what you did for a mean: the tail comes from the alternative, the p-value is the area beyond the observed p prime, and the conclusion is a sentence about the population proportion in the words of the problem.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 476-477 — Example 9.17: use the distribution for P′, the estimated proportion
Notation
This formula looks like the confidence-interval formula from Chapter 8, with one important difference in the square root. Hover over each piece to see it.
Annotate
On: \( z = \frac{p' - p_0}{\sqrt{p_0 q_0 / n}} \)
Using p prime in a test is a small error when p prime is close to p nought, and a larger one when it is not. In the flea example the two standard deviations are 0.0668 and 0.0757, different enough to move the test statistic from 2.32 to 2.04.
Why the difference from an interval? A confidence interval has no null to lean on, so it estimates the spread from the sample. A test assumes the null is true for the sake of argument, and under that assumption the spread is known exactly. Example 9.19 uses both formulas side by side, which makes the contrast concrete.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 476-480 — Examples 9.17 and 9.19
Worked example
Joon believes that 50 percent of first-time brides in the United States are younger than their grooms. She tests whether the percentage is the same or different from 50 percent. Of 100 first-time brides sampled, 53 say they are younger than their grooms. Use a 1 percent level of significance.
The words the same or different are a not-equal alternative, so the test is two-tailed. The data are a count out of a total, so the parameter is a proportion. Check the conditions: 100 times 0.5 is 50 for both successes and failures.
Set up the hypotheses
Why: a single proportion; different means not equal.
\[ H_0: p = 0.50 \qquad H_a: p \ne 0.50 \]
The sample proportion
Why: 53 successes in 100.
\[ p' = \frac{53}{100} = 0.53 \]
The standard deviation under the null
Why: built from the null's 0.50.
\[ \sqrt{\frac{(0.50)(0.50)}{100}} = \sqrt{0.0025} = 0.05 \]
The test statistic
Why: three points in standard deviations.
\[ z = \frac{0.53 - 0.50}{0.05} = 0.6 \]
One tail, then double
Why: the mirror of 0.53 is 0.47.
\[ p\text{-value} = 2\,P(Z > 0.6) = 2(0.2743) = 0.5485 \]
Compare and decide
Why: the p-value is far above alpha.
\[ 0.5485 > 0.01 \;\Longrightarrow\; \text{do not reject } H_0 \]
Figure (svg): The normal curve for the sample proportion, centred at 0.50 with standard deviation 0.05, from 0.33 to 0.67. Both tails are shaded red: below 0.47 and above 0.53, each labelled 0.2743. A yellow line marks the observed 0.53 and a dashed line marks its mirror, 0.47.
In context: at the 1 percent level the sample does not show sufficient evidence that the percentage of first-time brides younger than their grooms differs from 50 percent. The Type I error would be concluding it differs when it is 50 percent; the Type II error would be finding no evidence when it really does differ.
Check against the calculator
Why: the 1-PropZTest reports z of 0.6 and p of 0.5485, matching every line.
\[ z = 0.6, \quad p = 0.5485 \]
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 476-477 — Example 9.17 and Figure 9.10
Trap
After Example 9.17, a first attempt at the conclusion reads:
\[ p\text{-value} = 0.5485 \]
\[ \text{so } p = 0.50 \]
Wrong. Not rejecting is not accepting.
A large p-value says only that the data are consistent with one half. They are also consistent with many other values: a 95 percent interval from these data runs from about 0.43 to 0.63.
\[ 0.53 \pm 1.96\sqrt{\frac{(0.53)(0.47)}{100}} \]
\[ = (0.432,\; 0.628) \]
The right sentence: there is not sufficient evidence that the percentage differs from 50 percent.
Roughly every value in that interval, from 43 to 63 percent, would also have survived this 1 percent test.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 468 — do not reject H0 does not mean you should believe H0 is true
Worked example
A teacher believes 85 percent of students will want to go on a field trip to the zoo. She tests whether the percentage is the same or different from 85 percent. Of 50 students sampled, 39 want to go. Use a 1 percent level of significance.
Same or different again means two-tailed. With n equal to 50, check both conditions before trusting the normal curve: the expected failures are the tight one here.
Hypotheses
Why: different from 85 percent.
\[ H_0: p = 0.85 \qquad H_a: p \ne 0.85 \]
Check the conditions
Why: both expected counts must be at least 5.
\[ 50(0.85) = 42.5, \quad 50(0.15) = 7.5 \]
The sample proportion
Why: 39 of 50.
\[ p' = \frac{39}{50} = 0.78 \]
The standard deviation under the null
Why: from 0.85 and 0.15.
\[ \sqrt{\frac{(0.85)(0.15)}{50}} = \sqrt{0.00255} = 0.0505 \]
The test statistic
Why: seven points below the claim.
\[ z = \frac{0.78 - 0.85}{0.0505} = -1.386 \]
Double the left tail
Why: two-tailed.
\[ p\text{-value} = 2(0.0828) = 0.1657 > 0.01 \]
In context: do not reject; at the 1 percent level there is not sufficient evidence that the percentage of students who want to go to the zoo differs from 85 percent. Seventy-eight percent in a class of 50 is well within ordinary sampling variation.
Check with the critical value
Why: a two-tailed test at 1 percent rejects only beyond 2.576 on either side.
\[ |z| = 1.386 < 2.576 \]
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 477 — Try It 9.17
Worked example
A consumer group suspects that 30 percent of households have three cell phones. A cell phone company believes the proportion is not 30 percent. Its marketers survey 150 households, and 43 have three cell phones. Answer the book's parts: p prime, the success, the level, the graph and p-value, and the decision.
Not 30 percent is a not-equal claim, so two-tailed. No alpha is given, so the book uses the standard 5 percent. The conditions hold comfortably: 150 times 0.3 is 45 and 150 times 0.7 is 105.
Hypotheses
Why: the company's claim is not equal.
\[ H_0: p = 0.30 \qquad H_a: p \ne 0.30 \]
(a) The sample proportion
Why: x is 43 and n is 150.
\[ p' = \frac{43}{150} = 0.2867 \]
(b) and (c) The success and the level
Why: a success is a household with three phones; alpha is not given.
\[ \alpha = 0.05 \]
The standard deviation under the null
Why: from 0.30 and 0.70.
\[ \sqrt{\frac{(0.30)(0.70)}{150}} = \sqrt{0.0014} = 0.0374 \]
The test statistic
Why: slightly below 0.30.
\[ z = \frac{0.2867 - 0.30}{0.0374} = -0.356 \]
(d) Double the left tail
Why: the mirror of 0.2867 is 0.3133.
\[ p\text{-value} = 2(0.3608) = 0.7216 \]
Figure (svg): The normal curve for the sample proportion, centred at 0.30 with standard deviation 0.0374, from 0.17 to 0.43. A yellow line marks the observed 0.2867 and a dashed line marks its mirror 0.3133. The area below 0.2867 and the area above 0.3133 are shaded red, each about 0.3608.
(e) In context: do not reject, because 0.05 is less than 0.7216. There is not sufficient evidence that the proportion of households with three cell phones is different from 30 percent, so the company has no statistical grounds for its belief from this survey.
Check the mirror point
Why: a two-tailed picture needs the value as far above 0.30 as 0.2867 is below it.
\[ 0.30 + (0.30 - 0.2867) = 0.3133 \]
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 477-478 — Example 9.18
Worked example
Marketers believe that 92 percent of adults in the United States own a cell phone. A manufacturer believes the number is actually lower. Of 200 adults surveyed, 174 report having cell phones. Use a 5 percent level, and identify both errors.
Lower is a less-than claim, so the test is left-tailed. Check the conditions: 200 times 0.08 is 16, comfortably above 5.
Hypotheses
Why: the marketers' figure is the null.
\[ H_0: p = 0.92 \qquad H_a: p < 0.92 \]
The sample proportion
Why: 174 of 200.
\[ p' = \frac{174}{200} = 0.87 \]
The standard deviation under the null
Why: from 0.92 and 0.08.
\[ \sqrt{\frac{(0.92)(0.08)}{200}} = \sqrt{0.000368} = 0.0192 \]
The test statistic
Why: five points below.
\[ z = \frac{0.87 - 0.92}{0.0192} = -2.61 \]
The left-tail area
Why: the alternative is less-than.
\[ p\text{-value} = P(Z < -2.61) = 0.0046 < 0.05 \]
Figure (svg): The normal curve for the sample proportion, centred at 0.92 with standard deviation 0.0192, from 0.85 to 0.99. A yellow line marks the observed 0.87 far in the left tail; the sliver of area to its left is shaded red and labelled p-value 0.0046.
In context: reject; there is sufficient evidence that fewer than 92 percent of American adults own a cell phone. Type I error: concluding fewer than 92 percent own one when 92 percent really do. Type II error: finding no evidence when the true percentage really is lower.
Check with the critical value
Why: the 5 percent left-tail cutoff for the proportion is 0.92 minus 1.645 standard deviations, and 0.87 is below it.
\[ 0.92 - 1.645(0.0192) = 0.888 > 0.87 \]
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 478 — Try It 9.18
Worked example
Nicole Hart's poem: Bubble Hype shampoo killed only 25 percent of fleas. A new shampoo promises to kill more. Fido had 42 fleas before his bath, and the new shampoo killed 17. At a level of 0.01, should the owner use the new shampoo?
The claim is that the new shampoo kills more than 25 percent, so the test is right-tailed for a proportion. Check the conditions: 42 times 0.25 is 10.5 and 42 times 0.75 is 31.5.
Hypotheses
Why: more than the old 25 percent.
\[ H_0: p \le 0.25 \qquad H_a: p > 0.25 \]
The sample proportion
Why: fleas killed over fleas found.
\[ p' = \frac{17}{42} = 0.4048 \]
The standard deviation under the null
Why: from 0.25 and 0.75.
\[ \sqrt{\frac{(0.25)(0.75)}{42}} = 0.0668 \]
The test statistic
Why: the book reports 2.3163.
\[ z = \frac{0.4048 - 0.25}{0.0668} = 2.3163 \]
The right-tail area
Why: beyond the observed 0.4048.
\[ p\text{-value} = P(Z > 2.3163) = 0.0103 \]
Compare and decide
Why: alpha is just below the p-value.
\[ 0.01 < 0.0103 \;\Longrightarrow\; \text{do not reject } H_0 \]
Figure (svg): The normal curve for the sample proportion of fleas killed, centred at 0.25 with standard deviation 0.0668, from 0.02 to 0.5. The area right of the observed 0.4048 is shaded red and labelled p-value 0.0103. A yellow dashed line at 0.4054, the cutoff for alpha 0.01, sits almost on top of the observed value.
In context: at the 1 percent level the data do not show sufficient evidence that the new shampoo kills more than 25 percent of fleas. The book's own note is the right reading: the result is not very definitive, since the p-value is so close to alpha, and another bath after the fleas return would be the sensible next step.
Check with the critical value
Why: at 1 percent the right-tail cutoff is z of 2.326, and 2.316 just misses it.
\[ z = 2.316 < 2.326 \]
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 478-480 — Example 9.19, Figure 9.11 and Table 9.4
Worked example
The book then asks for a 95 percent confidence interval for the true proportion of fleas killed by the new shampoo, with a sketch that labels the point estimate and both bounds.
An interval does not assume any null, so its standard deviation uses p prime itself, not 0.25. That is the difference flagged on the notation slide, now in action.
The estimated standard deviation
Why: from p prime and 1 minus p prime.
\[ \sqrt{\frac{(0.4048)(0.5952)}{42}} = 0.0757 \]
The error bound at 95 percent
Why: 1.96 standard deviations.
\[ EBP = 1.96(0.0757) = 0.1484 \]
The interval
Why: the point estimate plus and minus the bound.
\[ 0.4048 \pm 0.1484 = (0.256,\; 0.553) \]
Figure (svg): A number line from 0.15 to 0.65. Two horizontal interval bars, each with a dot at 0.4048. The upper bar, the 95 percent interval, runs from 0.256 to 0.553. The lower bar, the 99 percent interval, runs from 0.210 to 0.600. A red dashed line at 0.25 lies just outside the upper bar and inside the lower one.
In context: we are 95 percent confident that the true proportion of fleas killed by the new shampoo is between about 26 percent and 55 percent, as the book reports. That interval just excludes 0.25, which seems to clash with the test's failure to reject.
There is no clash. The test used a 1 percent level, which corresponds to a 99 percent interval, and that interval, 0.210 to 0.600, does contain 0.25. Match the confidence level to the significance level before comparing an interval with a test.
Check the 99 percent interval
Why: 2.576 standard deviations either side of the estimate.
\[ 0.4048 \pm 2.576(0.0757) = (0.210,\; 0.600) \]
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 480 — Example 9.19, Figure 9.12: confidence interval (0.26, 0.55)
Fill the middle
A car soap removes 30 percent of stains. After a new compound is added, it washes out 20 of the 50 stains on a car. At a level of 0.01, is the compound beneficial? This is a right-tailed test of H nought, p equal to 0.30, against p greater than 0.30. Fill in the three numbers.
Fill in the blanks
p' = \frac0.40.4 = 1.54, \quad z = \frac0.0614 - 0.30}___} = ___, \quad p\text___ = ___
Why: Twenty of fifty is 0.40. The standard deviation under the null is the square root of 0.21 over 50, which is 0.0648, so z is 0.10 over 0.0648, about 1.54, and the area to its right is 0.0614.
In context: since 0.0614 is greater than 0.01, do not reject. There is not sufficient evidence at the 1 percent level that the new compound makes the soap remove more than 30 percent of stains. The conditions hold: 50 times 0.30 is 15 and 50 times 0.70 is 35.
Compare it with the fleas. Both observed proportions are roughly fifteen points above the old rate, but the soap's evidence is weaker, because 50 stains on one car is a noisier sample than the null spread allows for at this strict level. A 10 percent level would have rejected.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 480-481 — Try It 9.19
Concept
Example 9.21 asks a question the earlier examples did not: why should the significance level be so low? The answer depends on what a Type I error would mean in the problem, not on any formula.
A Type I error rejects a true null. In Example 9.21 the null is that cell phone users get brain cancer at the ordinary rate. Rejecting it wrongly would announce a cancer risk that does not exist: alarming millions of users and misdirecting research. The book puts it as accepting a false claim about cancer-causing environments.
\[ P(\text{Type I error}) = \alpha \]
Because alpha is exactly the Type I error rate, lowering it is the direct way to make that error rarer. The price, from Section 9.2, is a larger chance of a Type II error: missing a real effect.
| situation | costlier error | sensible α |
|---|---|---|
| a claim of a cancer link | Type I: a false alarm | small, such as 0.005 |
| screening a shampoo | neither is severe | the default 0.05 |
| a first look for any effect | Type II: missing it | larger, such as 0.10 |
Whatever level you choose, choose it from the consequences and before the data arrive. That makes alpha a decision about values, which is why the problem, not the statistician's convenience, should set it.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 481-482 — Example 9.21: explain why the significance level should be so low
Worked example
In a study of 420,019 cell phone users, 172 developed brain cancer. The rate for non-users is 0.0340 percent. Test the claim that cell phone users develop brain cancer at a greater rate, using a 0.005 significance level.
Greater rate is a greater-than claim: right-tailed. The rates are tiny, so the conditions need checking, and it helps to read the proportions per 10,000 people: 3.4 per 10,000 for non-users.
Hypotheses
Why: the non-user rate as a proportion.
\[ H_0: p \le 0.00034 \qquad H_a: p > 0.00034 \]
Check the conditions
Why: the book's own check, both well above 5.
\[ np = 420{,}019(0.00034) = 142.8 \]
The sample proportion
Why: about 4.1 cases per 10,000.
\[ p' = \frac{172}{420{,}019} = 0.0004095 \]
The standard deviation under the null
Why: about 0.28 per 10,000.
\[ \sqrt{\frac{(0.00034)(0.99966)}{420{,}019}} = 0.00002845 \]
The test statistic
Why: the gap in standard deviations.
\[ z = \frac{0.0004095 - 0.00034}{0.00002845} = 2.443 \]
The right-tail area
Why: compare with the strict alpha.
\[ p\text{-value} = P(Z > 2.443) = 0.0073 > 0.005 \]
Figure (svg): The normal curve for the rate of brain cancer per 10,000 users, centred at 3.4 with standard deviation 0.284, from 2.4 to 4.6. The area right of the observed 4.095 is shaded red and labelled p-value 0.0073. A yellow dashed line at 4.133 marks the cutoff for alpha 0.005, just beyond the observation.
In context: do not reject. There is not enough evidence at the 0.005 level to support the claim of higher brain cancer rates among cell phone users. At the default 5 percent the same data would reject; the strict level, chosen in advance because of the cost of a false alarm, is what decides this case.
Check with the critical value
Why: a right tail of 0.005 starts at z of 2.576.
\[ z = 2.443 < 2.576 \]
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 481-482 — Example 9.21 and Figures 9.13-9.14
Worked example
Of 390,000 moisturiser users, 138 developed skin diseases. The rate for non-users is 0.041 percent. Test the claim that moisturiser users develop skin diseases at a greater rate, at a 0.005 significance level.
The setup mirrors Example 9.21: right-tailed, a tiny proportion, a strict alpha for the same reason. But compare the sample rate with the claim before computing anything: the data may not point the way the claim does.
Hypotheses
Why: greater rate than 0.00041.
\[ H_0: p \le 0.00041 \qquad H_a: p > 0.00041 \]
The sample proportion
Why: below the null's rate.
\[ p' = \frac{138}{390{,}000} = 0.000354 < 0.00041 \]
The standard deviation under the null
Why: from 0.00041.
\[ \sqrt{\frac{(0.00041)(0.99959)}{390{,}000}} = 0.0000324 \]
The test statistic
Why: negative, because the sample is below the claim.
\[ z = \frac{0.000354 - 0.00041}{0.0000324} = -1.73 \]
The right-tail area
Why: the alternative is greater-than, so shade right of the observation.
\[ p\text{-value} = P(Z > -1.73) = 0.958 \]
Figure (svg): The normal curve for the rate of skin disease per 10,000 users, centred at 4.1 with standard deviation 0.324, from 3.0 to 5.2. A yellow line marks the observed rate 3.54, below the centre. The whole area to its right, about 96 percent of the curve, is shaded blue and labelled p-value 0.958.
In context: do not reject; the data give no support to the claim that moisturiser users develop skin disease at a higher rate. If anything the sample rate is lower. The low alpha matters for the same reason as before: a false alarm would wrongly brand a product as harmful.
Check the sign before the table
Why: a sample below the null in a greater-than test must give a p-value above one half.
\[ p' < p_0 \;\Longrightarrow\; p\text{-value} > 0.5 \]
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 482 — Try It 9.21
Worked example
A country has about 268,608,618 residents aged 12 and over, of whom 207,754 have blood type AB negative. In one province, 11 of 37,937 residents have it. Test at 0.01 whether the province's percentage differs from the country's.
Differs is not equal: two-tailed. The book rounds the national rate to 0.078 percent, but the division gives 0.0773 percent. Work the book's version, then see whether the rounding matters.
The national rate
Why: the division the book rounds.
\[ \frac{207{,}754}{268{,}608{,}618} = 0.000773 \]
Hypotheses, with the book's rounded rate
Why: a single proportion, not equal.
\[ H_0: p = 0.00078 \qquad H_a: p \ne 0.00078 \]
The sample proportion
Why: about 2.9 per 10,000, against 7.8.
\[ p' = \frac{11}{37{,}937} = 0.000290 \]
The standard deviation under the null
Why: from 0.00078.
\[ \sqrt{\frac{(0.00078)(0.99922)}{37{,}937}} = 0.0001433 \]
The test statistic
Why: the book reports minus 3.4189.
\[ z = \frac{0.000290 - 0.00078}{0.0001433} = -3.419 \]
Double the left tail
Why: the book's area to the left is 0.000314.
\[ p\text{-value} = 2(0.000314) = 0.00063 < 0.01 \]
Figure (svg): The normal curve for the rate of blood type AB negative per 10,000 people, centred at 7.8 with standard deviation 1.43, from 2 to 13.6. A yellow line marks the observed rate 2.90 far in the left tail; its mirror at 12.70 is a dashed line. The two tiny tails beyond them are shaded red and labelled 0.0003 each.
In context: reject; the data support the claim that the proportion of residents with blood type AB negative in this province differs from the national proportion. It is lower, about 2.9 per 10,000 against roughly 7.7 nationally. The conditions hold: 37,937 times 0.00078 is about 29.6.
Check with the unrounded national rate
Why: using 0.000773 gives z of minus 3.387 and p of 0.00071: still far below 0.01, so the rounding does not change the decision.
\[ 2\,P(Z < -3.387) = 0.00071 < 0.01 \]
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 482-483 — Example 9.22
Matching
Four of the section's problems, described only by what they give you. Match each to the distribution and tail its test uses. Two questions decide the distribution, mean or proportion and sigma or not, and the alternative decides the tail.
Match the pairs
Why: A given sigma means the normal curve for the sample mean; data with no sigma mean a t curve with n minus 1 degrees of freedom; a count out of a total means the normal curve for the sample proportion. Less than is left, more than is right, and different is both tails.
Notice that two of the four use the same curve, the normal for p prime, and differ only in the tail. And two are about a mean but use different curves. The two decisions are independent: settle the curve first, then the tail.
If a problem gives both a sigma and raw data, as the bench press did, use sigma. The data are then only for computing the sample mean.
Section
Part 6
Pattern
Every test in this section ran through the same decisions in the same order. The diagram is the part before the arithmetic, where most marks are lost.
Figure (svg): A decision flow. First box: mean or proportion. A mean leads to the question, is sigma given: if yes, the normal with z equal to x bar minus mu nought over sigma over root n; if no, Student's t with n minus 1 degrees of freedom and s in place of sigma. A proportion leads to the normal for p prime with standard deviation root of p nought q nought over n. All three arrows meet a final box: the tail comes from Ha, less-than left, greater-than right, not-equal both tails doubled.
Notice the order of the diagram. The two questions about the distribution come before any arithmetic, and the tail comes last because it does not depend on the distribution at all. A left-tailed t test and a left-tailed proportion test shade the same side; only the curve they shade differs.
Most wrong answers in this section are correct arithmetic in the wrong setting: the curve centred on the sample, a one-tail area for a two-sided claim, the normal curve where t belongs, p prime in the null's standard deviation. Each has a one-line check, and the steps above put each check where it belongs.
Discrimination
Sort each problem from this section by the distribution its test uses. Ignore the tail for now; this sort is only about the curve. Look for whether sigma is stated and whether the data are counts or measurements.
Sort into buckets
Sort each problem by the distribution for its test.
The stock problem is the mirror image: it has no long list of sigma-free measurements to tempt you, and its standard deviation of one dollar belongs to the stated belief, not to the ten weeks. And the two proportion problems differ wildly in size, 50 students against 420,019 users, yet both use the same curve once the conditions hold.
The bench press is the one that catches people: it has raw data, which suggests computing s and using t. But sigma is given, and the book says always use sigma if you know it.
Comparison
Fill in the blanks to complete the summary of the section's three tests. Each blank is a short word or formula you can type.
Comparison matrix
| test | parameter | centre of the curve | spread | distribution |
|---|---|---|---|---|
| mean, σ known | μ | μ₀ | σ/√n | normal |
| mean, σ unknown | μ | μ₀ | s/sqrt(n) | t, n − 1 df |
| proportion | p | p0 | √(p₀q₀/n) | normal |
The spread column is where most slips happen. For a mean it is a standard deviation divided by the square root of n; for a proportion the square root covers the whole fraction, p nought times q nought over n. Writing the square root of p nought q nought, divided by n, gives a spread far too small.
Read down the centre column: every test centres its curve on the null's value. Read down the spread column: only the t test estimates its spread from the sample, which is why only it pays the price of heavier tails.
And the column that is not here is the tail, because it is the same rule for all three: the alternative's symbol decides it, and a not-equal alternative doubles the one-tail area.
Check
Decide the tail from the alternative before looking at the options.
The alternative here has a not-equal sign, so think about how many tails the p-value occupies and what to do with the one-tail area.
Check your understanding
A test has the alternative that the mean is not equal to 40. The test statistic is z = −2.10, and the area to the left of −2.10 is 0.0179. What is the p-value?
Answer: A
Why: A not-equal alternative counts results this far out on either side, so the p-value is the left tail plus its mirror on the right: two times 0.0179, which is 0.0357.
In context: at the 5 percent level this rejects, since 0.0357 is below 0.05; at 1 percent it would not. The single-tail value 0.0179 would have rejected at 2.5 percent too, which is exactly the kind of overstatement that forgetting the doubling causes.
A quick check for any two-tailed p-value: it is twice something no bigger than one half, so it can never exceed one.
Check
Look for whether a population standard deviation is stated.
Read the problem for the source of each number. A standard deviation computed from the sample is s, not sigma, and that decides the curve.
Check your understanding
A sample of 12 batteries has mean life 41.5 hours and sample standard deviation 3.2 hours, from a normal population. No population standard deviation is known. Which distribution should be used to test whether the mean life is 40 hours?
Answer: A
Why: Sigma is unknown and only sample data are given, so the test statistic uses s and follows a t curve. The degrees of freedom are the sample size minus one, which is 11.
In context: the test statistic would be 1.5 over 3.2 divided by the square root of 12, which is 1.62, read against a t curve with 11 degrees of freedom. Whether it is left, right or two-tailed would depend on the claim, which this question deliberately left out.
The habit that prevents the error: label each number in the problem as from the null, from the population, or from the sample, before writing any formula.
Check
Judge each option by what a test can and cannot say.
Remember that a decision is about the null, a conclusion is about the population in the words of the problem, and a p-value is a probability about samples, not about the hypothesis.
Check your understanding
A city says 30 percent of households compost. A council member thinks more do. A test of H₀: p = 0.30 against Hₐ: p > 0.30 at α = 0.05 gives a p-value of 0.12. Which statement is correct?
Answer: A
Why: The p-value is above alpha, so the decision is not to reject. The conclusion then says only that the evidence is not sufficient for the council member's claim, in the words of the problem, without claiming the city's figure is proven.
In context: the council member's belief is not supported by this sample at the 5 percent level, but it is not refuted either. A larger survey could still find evidence for it.
Each wrong option is a misreading you have met in this deck: acceptance in place of failure to reject, the decision rule backwards, and the p-value read as a probability about the hypothesis.
Explain it to yourself
The flea-shampoo test was the closest call in the section: a p-value of 0.0103 against an alpha of 0.01. Explaining it without jargon is the best test of whether the decision and its limits have landed.
Discussion prompt
In three or four plain sentences, tell Fido's owner what the test found, why it did not reject, and what you would do next. Do not use the words null, alpha or p-value.
Notice what a good answer leaves out. It does not say the shampoo does not work, and it does not say there is a 1 percent chance the shampoo is no better. Both are tempting and both claim more than the test can deliver.
A strong answer names the evidence, about 40 percent killed against 25, the reason for caution, the small sample and the strict standard, and the fact that the call was close. A very strong one adds that a 99 percent interval for the kill rate, 21 to 60 percent, still includes 25 percent.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 480 — Example 9.19's note: this test result is not very definitive
Exit ticket
Try It 9.22. About 201,456,463 United States residents are aged 20 and over, and about 104,354 murders occur each year in that group, a rate the book gives as 0.052 percent. Ohio reported 127 murders in a population of 427,648. Test at 0.01 whether Ohio's rate differs from the national rate.
Discussion prompt
Write the hypotheses, compute the test statistic and p-value, and state the decision and the conclusion in context.
Check the conditions too: 427,648 times 0.00052 is about 222, far above 5, so the normal curve is safe even though the rate is tiny.
Differs is not equal, so the test is two-tailed, and the doubled tail is still essentially zero. The national rate divides out to 0.0518 percent; using that instead of the book's 0.052 gives z of minus 6.35 and the same decision.
If you got a p-value near one half, you probably used the sample proportion in the standard deviation and lost a decimal place, or shaded the wrong side. Sketch the curve centred at 5.2 per 10,000 and mark 3.0: it is far out in the left tail.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, p. 483 — Try It 9.22
Recap
A full hypothesis test is a fixed sequence: hypotheses from the claim, a distribution chosen by the parameter and by whether sigma is known, a test statistic from the data, a p-value whose tail comes from the alternative, a comparison with an alpha set in advance, and a conclusion in the words of the problem.
| idea | formula or rule | read it as |
|---|---|---|
| decision | reject H₀ if p-value < α | the data are rarer than the risk you accepted |
| tail | < left · > right · ≠ both | the alternative decides, never the data |
| two-tailed | p = 2·P(Z ≥ |z|) | the mirror image is just as extreme |
| mean, σ known | z = (x̄ − μ₀)/(σ/√n) | centred on the null, not the sample |
| mean, σ unknown | t = (x̄ − μ₀)/(s/√n), n − 1 df | heavier tails pay for estimating σ |
| proportion | z = (p′ − p₀)/√(p₀q₀/n) | spread from p₀; need np, nq ≥ 5 |
| conclusion | sufficient / not sufficient evidence | never proof, never acceptance of H₀ |
Beyond the formulas, the section asks for judgement: a p-value of 0.001 and one of 0.04 both reject at 5 percent, but they do not carry the same weight, and a result such as the flea shampoo's deserves a sentence saying how close it was. Choose alpha from the cost of a Type I error, and choose it first.
The Introductory Business Statistics text works more full examples in its own section 9.4 in business settings, if you want further practice. Chapter 10 extends the same six steps to comparing two populations.
OpenStax Introductory Statistics 2e, §9.5 Additional Information and Full Hypothesis Test Examples §9.5, pp. 468-483 — the whole section
OpenStax Introductory Business Statistics 2e, §9.4 Full Hypothesis Test Examples §9.4 Full Hypothesis Test Examples — the same tests in business contexts
Want this taught 1-on-1? Alexander tutors Statistics — $55/session, free consultation.