Chapter 14 — Tests for Means & Proportions
The module's primary reading · ~45–55 minutes · Objective 7 (carry out and correctly interpret hypothesis tests for means and proportions, including one- and two-sample settings, p-values, significance levels, and Type I and Type II errors), Objective 6 (construct and correctly interpret confidence intervals for a population mean and a population proportion, including the meaning of the confidence level and the margin of error) · Read it first this week; the lecture, the tutorial, the quiz, and the Data Lab all build on it.
In plain language
Last week you learned how a hypothesis test (a way to weigh data against a claim by asking how surprising the data would be if the claim were true) works on a guessing quiz. This week you run the same logic on the questions people ask most often: whether an average differs from a claimed value or from another group's average, and whether a share differs from a claimed share or from another group's share. You will learn four tests, one for each of those questions, and how to read them from a spreadsheet or from software. You will also see that a test and a confidence interval (a range of believable values for a population's true value) are two views of the same question. Choosing the right test, and saying honestly what its answer means, is the main skill of the week.
Why you already care about this
A juice bottle's label says 1 liter. A ride-share app says pickups take 6 minutes on average. A phone maker claims a battery lasts 20 hours. Every one of those is a claim about an average, and every one invites the same question: if you measured a few, would a gap from the label mean anything?
Claims about shares are everywhere too. A poll says 54% of 1,000 adults support a proposal. A coffee shop says 2 in 3 customers prefer its new blend. Is 54% really more than half, or could an even split produce a poll like that by luck?
Field biologists ask the same questions about penguins. Suppose someone tells you that Adelie penguins average 4,000 g. A research team weighed 151 of them, and their mean was 3,700.66 g. Is that 299 g gap real, or is it the wobble you expect from one sample? This chapter gives you the tools to answer, and the words to say what the answer means.
By the end of this chapter you will be able to:
- carry out a one-sample t test for a mean, from the hypotheses to a conclusion in context;
- explain why a value that is ordinary for one individual can be wildly unusual as a mean;
- carry out a two-sample t test and read the difference, the standard error, Welch's t, the degrees of freedom, and the p-value from software output;
- carry out a one-proportion z test and a two-proportion z test, checking the large-counts condition first;
- explain why "not significant" does not mean "no difference";
- use a confidence interval to predict a two-sided test's decision, and say how big an effect is;
- choose the right procedure from the question, the type of variable, and the number of groups.
Carry this sentence with you: a test asks "is there a gap?" — an interval asks "how big?"
Where we are
- Already covered: Weeks 1 to 10 built description, probability, the normal model, and the standard error. Weeks 11 and 12 built confidence intervals, and Week 13 introduced the logic of a hypothesis test.
- This week: tests for means and proportions: the one-sample t test, the two-sample t test, the one-proportion z test, the two-proportion z test, the link between tests and intervals, and how to choose among them.
- How they connect: every test this week uses Week 13's logic (assume H₀, measure the surprise, compare the p-value with α) and Week 10's standard error to measure that surprise in standard errors.
- Where we're going next: this week closes the inference unit. Week 15 asks a new question: can you predict one variable from another with a line, and can you test whether that line's slope is real?
Four earlier weeks matter most here. Week 8 gave you the z-score: how many standard deviations a value sits from a mean. Week 10 gave you the standard error (how much a statistic typically wobbles from sample to sample). Week 11 gave you the t distribution, the degrees of freedom, and the 95% interval for the Adelie mean, 3,626.92 g to 3,774.40 g. Week 13 gave you the null hypothesis H₀, the claim of no effect that a test assumes for the sake of argument, and the alternative hypothesis Hₐ, the claim you look for evidence of. It also gave you the p-value, the probability, computed assuming H₀ is true, of data at least as extreme as yours. Finally, it gave you the significance level α, the cutoff you choose before you look. This week those pieces become four working tests.
1. Run the one-sample t test: count standard errors to the claim
Start with a plain question. Someone claims that Adelie penguins like the ones in the Palmer field study average 4,000 g. You have 151 weighed birds with a mean of 3,700.66 g. How far is 3,700.66 g from 4,000 g, measured in the wobble a mean usually has?
That is the whole idea of a one-sample t test. You count how many standard errors separate your sample mean from the claimed value. If the count is small, the gap is the kind of wobble you expect. If the count is large, the claim is hard to believe.
The claimed value has a name.
- The null value is the specific value of a parameter that the null hypothesis claims, written μ₀ for a mean or p₀ for a proportion; a test measures how far the sample result sits from it.
You read μ₀ as "mu naught." The test that uses it has a standard form.
- A one-sample t test is a hypothesis test for a population mean when σ is unknown; it computes t = (x̄ − μ₀) ⁄ (s ⁄ √n) and reads it against a t distribution with n − 1 degrees of freedom.
- The t statistic is the test statistic for a mean or a difference in means: the number of standard errors between the sample result and the null value, read against a t distribution.
The bottom of that fraction, s ⁄ √n, is the same standard error you used for the Week 11 interval. The top is the gap between the data and the claim.
Worked example — the 4,000 g claim. The claimed value is a hypothetical null value, chosen to teach the test.
- Write the hypotheses. H₀: μ = 4,000 g. Hₐ: μ ≠ 4,000 g. The alternative is two-sided because a mean that is too high or too low would both count against the claim.
- Gather the summary. n (the sample size) is 151, x̄ (the sample mean) is 3,700.66 g, s (the sample standard deviation) is 458.57 g, and SE (the standard error) is 37.32 g. Each is rounded from the pinned values to two decimals.
- Check the conditions. The penguins come from an observational field study, not a random draw, so you treat them as representative of Adelie penguins in that region and say so. Each bird is weighed separately. A sample of 151 is far above the rule of thumb of about 30, so the sampling distribution of x̄ is approximately normal.
- Compute the t statistic. t (the t statistic) = (3,700.66 − 4,000) ⁄ 37.32 = −299.34 ⁄ 37.32 ≈ −8.02, rounded to two decimals.
- Find the degrees of freedom. df (the degrees of freedom) = 151 − 1 = 150. The critical value t* for 95% with df = 150 is 1.976, so any t beyond ±1.976 rejects H₀ at α = 0.05.
- Decide. −8.02 is far beyond −1.976. The p-value is far below 0.001, so you reject H₀ at α = 0.05.
In words: the sample mean sits about 8 standard errors below 4,000 g. If Adelie penguins really averaged 4,000 g, a sample of 151 birds would almost never average as low as 3,700.66 g. A biologist would decide the 4,000 g claim does not fit these birds.
In practice (your tools). In Google Sheets or Excel, compute the statistic in one cell: =(3700.66-4000)/37.32 returns about -8.02. Then =T.DIST.2T(8.02, 150) returns the two-sided p-value for that t with 150 degrees of freedom. The first input must be the size of t without its sign, so type 8.02, not -8.02. The answer appears in scientific notation, with a dozen zeros after the decimal point. That p-value is far below 0.001.
Misconception check — "the sign tells you whether to reject". Students often think a negative t means "no evidence", because negative numbers feel like "less." It is tempting, since −8.02 looks smaller than 2. But for a two-sided test, the sign only says which side of μ₀ the data fell on. Distance is what counts. The cure: compare the size of t, ignoring its sign, with t*, and say in words which direction the data point.
Memory hook: measure the gap in standard errors; never in raw grams.
2. Read the result in words: one bird versus the mean
Here is a puzzle. In Week 8 you met a single Adelie penguin that weighed 4,000 g. Its z-score was about 0.65. That bird was a little heavy, but ordinary. So how can a mean of 4,000 g be so far out?
The key is the difference between the standard deviation and the standard error. Single birds vary a lot: the standard deviation is 458.57 g. Averages of 151 birds vary much less: the standard error is 37.32 g. The same 299 g gap is less than one standard deviation for one bird. It is about 8 standard errors for a mean.
Worked example — the same weight, two yardsticks. Put one bird and one mean side by side.
- One bird. A single 4,000 g Adelie has a z-score of about 0.65, an ordinary bird.
- The mean. A mean of 4,000 g would sit 8.02 standard errors away from the sample mean.
- Compare the yardsticks. The standard error of 37.32 g is much smaller than the standard deviation of 458.57 g. The standard error versus the standard deviation is about a 12-fold difference, because √151 ≈ 12.29.
In words: a heavy bird is common, but a heavy average is not. Averages smooth out the luck of single birds. A field team deciding whether a whole population has changed should look at the mean and its standard error, not at one unusual bird.
Misconception check — "if one 4,000 g bird is ordinary, a 4,000 g mean is ordinary too". Students often use the standard deviation to judge a mean. It is tempting, because both are measured in grams. But the standard deviation describes single birds, and the standard error describes averages. Using s instead of SE in the t statistic would make the gap look about 12 times smaller than it is. The cure: say "standard error" every time you judge a mean, and check that you divided s by √n.
Pause and reflect — choose one. Pick either of the 2 prompts; they count the same.
- (a) Think of something you measure often, such as a commute, a grocery bill, or a night's sleep. Describe one value that would be ordinary on a single day but surprising as a monthly average, and say why.
- (b) A friend says, "One penguin weighed 4,000 g, so 4,000 g is a perfectly normal weight; the claim must be fine." Write two or three sentences that explain the friend's mix-up.
Memory hook: single birds wobble a lot; averages wobble a little.
3. Compare two means: set up the two-sample t test
Gentoo penguins look bigger than Adelie penguins. But "look bigger" is not evidence. A careful question asks: is the gap between the two sample means larger than the wobble you would expect if the two populations had the same mean?
Two groups bring one new requirement. The individuals in one group must have no link to the individuals in the other.
- Independent samples are two samples in which the individuals in one group have no link to the individuals in the other, such as two species of birds weighed separately.
With independent samples, the test compares the two means directly.
- A two-sample t test is a hypothesis test that compares the means of two independent groups by dividing the difference in sample means by the standard error of that difference and reading the result against a t distribution.
- The standard error of a difference in means is how much the difference between two independent sample means typically wobbles from sample to sample, found as the square root of s₁² ⁄ n₁ plus s₂² ⁄ n₂.
The subscripts 1 and 2 name the two groups. The null value is a difference of 0: under H₀ the two population means are equal.
Worked example — setting up Gentoo versus Adelie. Write the test down before any arithmetic.
- Write the hypotheses. H₀: μ for Gentoo − μ for Adelie = 0. Hₐ: the difference is not 0.
- Gather the two samples. 123 Gentoo penguins with mean 5,076.02 g and standard deviation 504.12 g; 151 Adelie penguins with mean 3,700.66 g and standard deviation 458.57 g.
- Check independence. The two groups are different birds, so they are independent samples.
- Check the other conditions. Both samples come from the same field study, so the representativeness caveat from Section 1 applies to both. Both samples are far above the rule of thumb of about 30.
- Find the difference. From the unrounded means, the Gentoo mean minus the Adelie mean is 1,375.35 g.
- Find its standard error. Square each standard deviation, divide by its sample size, add the two results, and take the square root. Here √(504.12² ⁄ 123 + 458.57² ⁄ 151) = √(2,066.15 + 1,392.63) = √3,458.78 ≈ 58.81 g.
In words: the Gentoo sample averages about 1,375 g more than the Adelie sample. A difference in means from samples this size typically wobbles by about 59 g. A biologist can already see that the gap is many standard errors wide; the next section reads the exact verdict from software.
Notice that the standard error of the difference, 58.81 g, is bigger than either group's own standard error. Two means each wobble, and their wobbles add.
Misconception check — "subtract the two standard errors". Students often subtract one group's standard error from the other's, or add the standard deviations directly. It is tempting, because the difference in means is a subtraction. But wobbles never cancel; they add, and they add as squares. The cure: square, divide, add, then take the square root, in that order, every time.
Memory hook: two wobbles add up — they never cancel.
4. Read the software output: Welch's t and its degrees of freedom
Most of the time, you will not compute a two-sample t test by hand. You will read it from a spreadsheet or from statistical software. The skill is knowing which number answers which question.
Software reports one number you never compute yourself.
- Welch's degrees of freedom are the degrees of freedom for a two-sample t procedure that does not assume equal population standard deviations; software computes and reports them, often as a decimal such as 249.6.
Here is what a typical output reports for the penguins, written out in words in a table.
| What the output reports | Value for the penguins |
|---|---|
| Gentoo sample: size, mean, standard deviation | 123 birds, 5,076.02 g, 504.12 g |
| Adelie sample: size, mean, standard deviation | 151 birds, 3,700.66 g, 458.57 g |
| Difference in means, Gentoo minus Adelie | 1,375.35 g |
| Standard error of the difference | 58.81 g |
| Welch's t | 23.386 |
| Degrees of freedom (Welch's approximation) | about 249.6 |
| Two-sided p-value | far below 0.001 |
Worked example — reading the penguin output. Take the rows of the table one at a time.
- Find the statistic. The output reports t = 23.386, the difference of 1,375.35 g divided by the standard error of 58.81 g, rounded to three decimals.
- Find the degrees of freedom. It reports about 249.6 degrees of freedom from Welch's approximation, and a p-value far below 0.001.
- Decide. Reject H₀. The data give very strong evidence that the mean body masses differ.
- Say it in context. If Gentoo and Adelie penguins like these had the same mean mass, a gap as large as 1,375 g would essentially never appear in samples this size.
In words: the gap is about 23 standard errors wide, so luck cannot explain it. A biologist comparing the two species can treat the difference in mean mass as real for penguins like those studied.
In practice (your tools). In Google Sheets or Excel, put the Gentoo masses in one column and the Adelie masses in another. Then =T.TEST(A2:A124, B2:B152, 2, 3) returns the two-sided p-value. The third input, 2, asks for two tails; the fourth input, 3, asks for the unequal-variance (Welch) version. For the penguins it appears in scientific notation. That p-value is far below 0.001. A spreadsheet's T.TEST returns only the p-value; to see t itself, compute the difference and the standard error in their own cells, as in Section 3.
Honesty note: the penguins are an observational study. The test shows the species differ in mean mass among birds like those studied. It does not say why, and it does not cover penguins in other places or years.
Misconception check — "the degrees of freedom must be a whole number". Students often think 249.6 degrees of freedom is a typo, or round it to the total sample size. It is tempting, because one-sample degrees of freedom are always whole numbers. But Welch's approximation blends both samples' sizes and spreads, and it usually lands on a decimal. The cure: copy the degrees of freedom from the output, and never compute them by hand in this course.
Memory hook: read the output in order; do not jump to the p-value.
5. Test one proportion: is the split even?
Now switch from weights to categories. Of the 333 penguins with a recorded sex, 165 are female. That is a little under half. Is the gap from an even split real, or is it the wobble you expect from one sample?
A test for one proportion works like a test for one mean. You count standard errors from the claimed share to the sample share. One detail is new: the standard error uses the claimed share, not the sample's share.
- A one-proportion z test is a hypothesis test for a population proportion; it computes z = (p̂ − p₀) ⁄ √(p₀(1 − p₀) ⁄ n), with the null value inside the standard error, and reads z against the standard normal curve.
Why use p₀? Because the test assumes H₀ is true. If the true share is p₀, then the wobble of p̂ is set by p₀. The interval from Week 12 used p̂ instead, because an interval assumes nothing about the true share.
Worked example — testing an even sex split. Follow the same steps as the mean test.
- Write the hypotheses. H₀: p = 0.5. Hₐ: p ≠ 0.5.
- Find the sample share. 165 of the 333 sexed penguins are female, so p̂ = 165 ⁄ 333, the given sample proportion 0.4955 rounded to four decimals.
- Check the conditions. Under H₀ you expect 333 × 0.5 = 166.5 females and 166.5 males, both at least 10, so a normal model for p̂ is reasonable. The representativeness caveat from Section 1 applies here too.
- Compute the null standard error. You use the null value p₀ = 0.5, not p̂. So SE = √(0.5 × 0.5 ⁄ 333) = √(0.25 ⁄ 333), which matches the supplied SE of 0.0274.
- Compute the z statistic. z (the z statistic) = (0.4955 − 0.5) ⁄ 0.0274, which is the pinned −0.164 to three decimals. The sample share sits about 0.16 standard errors below 0.5.
- Find the p-value. The two-sided p-value is about 0.87. If the true split were even, a sample share at least this far from 0.5 would occur about 87% of the time.
- Decide. 0.87 is far above α = 0.05, so you fail to reject H₀. The data are consistent with an even sex split.
In words: 165 females out of 333 is the kind of result an even split produces all the time. About 87 samples in 100 would land at least this far from half. A biologist has no reason to think the population is lopsided.
In practice (your tools). In Google Sheets or Excel, =COUNTIF on the sex column returns 165 females and 168 males. Then =(165/333-0.5)/SQRT(0.25/333) returns the z statistic, about -0.164. For the two-sided p-value, =2*NORM.S.DIST(-0.164, TRUE) returns about 0.87. You double the lower tail because a two-sided test counts surprises on both sides.
Misconception check — "use the sample share in the test's standard error". Students often reuse the interval's standard error, built from p̂, inside the test. It is tempting, because the formula looks the same. But a test assumes H₀ and builds its wobble from p₀. With the penguins the two give nearly the same number, since p̂ is so close to 0.5; with a sample share far from p₀, they can differ a lot. The cure: in a test, put the null value inside the square root.
Memory hook: a test assumes the claim — so the claim sets the wobble.
6. Cure the misconception: "not significant" is not "no difference"
The sex test failed to reject H₀. It is tempting to write "the test proved half the penguins are female." That sentence is wrong, and this section shows why.
Worked example — the plausible values. Go back to the Week 12 interval for the same 333 birds.
- Recall the interval. The 95% one-proportion z interval runs from 0.4418 to 0.5492.
- Read what it contains. Values such as 0.47 and 0.52 sit inside it too.
- Conclude. The test did not prove p = 0.5.
In words: the data are consistent with an even split. They are also consistent with a population that is 47% female or 52% female. A test that fails to reject leaves a whole range of values standing, and 0.5 is only one of them. A biologist who needs to know the exact share would need more data, not a stronger sentence.
Think of a smoke alarm that stays quiet. Silence means no smoke was detected. It does not prove the air is perfectly clean; a little smoke might sit below what the alarm can sense. A test is the same: a quiet result means the data did not detect a difference.
Misconception check — "not significant means no difference". Students often read a large p-value as proof that H₀ is true. It is tempting, because "fail to reject" sounds close to "accept." But a large p-value says only that the data are consistent with H₀; they may be consistent with many other values too, especially with small samples. The cure: write "the data are consistent with …" or "the data do not give convincing evidence of …", and look at the interval to see which other values are still plausible.
Caveat: a small sample makes this trap worse. With only a few observations, almost any claim survives a test, because the wobble is so large. A "not significant" result from a tiny study says very little either way.
Pause and reflect — choose one. Pick either of the 2 prompts; they count the same.
- (a) A headline reads, "Study finds new tutoring program makes no difference to grades." The study's p-value was 0.30. Rewrite the headline so it says only what the data support, and explain your change in one or two sentences.
- (b) Describe a situation from your own life where "I didn't notice a difference" was not the same as "there was no difference." What would you need to notice a small difference?
Memory hook: "not significant" — not "no difference."
7. Compare two proportions: pool the samples under the null hypothesis
The last test compares two shares. The penguin study worked on several islands. On Biscoe and on Dream, the Adelie share looks different. Is the gap real?
- A two-proportion z test is a hypothesis test that compares the proportions of two independent groups by dividing the difference in sample proportions by a standard error built from the pooled proportion.
- The pooled proportion is the share of successes when two samples are combined, total successes divided by total sample size, used in a two-proportion z test because the null hypothesis says the two population proportions are equal.
Why pool? Because H₀ says the two shares are equal. If they are equal, your best estimate of that one shared value uses every bird from both islands.
Worked example — the Adelie share on Biscoe and Dream. Use the species-by-island counts from Week 2.
- Write the hypotheses. H₀: the two population shares are equal. Hₐ: they differ.
- Find the two shares. On Biscoe, 44 of 168 penguins are Adelie, about 26.2%. On Dream, 56 of 124 are Adelie, about 45.2%. The difference is 26.2 − 45.2 = −19.0 percentage points.
- Check the conditions. The counts 44 and 124 on Biscoe and 56 and 68 on Dream are all at least 10. The birds on the two islands are different birds. The field team chose which colonies to study, so the answer describes penguins like those monitored.
- Pool the samples. Under H₀ the two shares are equal, so you combine the samples. That gives (44 + 56) ⁄ (168 + 124) = 100 ⁄ 292, about 34.2%.
- Find the standard error. Multiply the pooled share by its complement and by (1 ⁄ 168 + 1 ⁄ 124), then take the square root. The result is about 5.62 percentage points.
- Compute the z statistic. z (the z statistic) = −19.0 ⁄ 5.62 ≈ −3.38, rounded to two decimals. The gap is about 3.38 standard errors below 0.
- Bound the p-value. Beyond 3 standard errors on both sides, a normal model leaves 1 − 0.9973 of its area, which is 0.27%. So the two-sided p-value is below 0.003, and you reject H₀ at α = 0.05 and at α = 0.01.
In words: if the Adelie share were the same on both islands, a gap of 19 points would show up in fewer than 3 samples in 1,000. A field team planning where to study Adelie penguins would expect a bigger share of them in the monitored colonies on Dream.
In practice (your tools). In Google Sheets or Excel, compute each piece in its own cell. =44/168 and =56/124 give the two shares, =100/292 gives the pooled share, and =SQRT(C1*(1-C1)*(1/168+1/124)) gives the standard error when the pooled share sits in C1. Divide the difference by the standard error for z. Then =2*NORM.S.DIST(-3.38, TRUE) returns the two-sided p-value, a number below 0.001.
Honesty note: the islands are not random samples of anything. The team chose its colonies, and a different choice of colonies could change the shares. The test compares the monitored colonies; it says nothing about why the shares differ.
Misconception check — "average the two shares to pool them". Students often pool by averaging 26.2% and 45.2% to get 35.7%. It is tempting, because "combine" sounds like "average." But the islands have different sample sizes, so a plain average gives Dream's smaller sample too much weight. The cure: pool by adding the successes and adding the sample sizes, (44 + 56) ⁄ (168 + 124).
Memory hook: pool the counts — not the percentages.
8. See tests and intervals as two views of one question
You have now seen the same pattern four times. A test counts standard errors from a claimed value. An interval reaches a set number of standard errors around the estimate. They are built from the same pieces, so they must agree.
- The duality of tests and intervals is the link between a two-sided test at level α and a confidence interval at level 1 − α: the test rejects a null value exactly when it lies outside the interval.
Worked example — the Adelie mean, two claims. Put the 4,000 g test from Section 1 next to a second claim.
- Recall the interval. The 95% t interval for the Adelie mean runs from 3,626.92 g to 3,774.40 g.
- Test a second null value. Test H₀: μ = 3,750 g. Then t (the t statistic) = (3,700.66 − 3,750) ⁄ 37.32 = −49.34 ⁄ 37.32 ≈ −1.32. That is inside ±1.976, so you fail to reject H₀ at α = 0.05.
- Compare. The value 4,000 g sits outside the interval, and the test rejected. The value 3,750 g sits inside it, and the test failed to reject.
In words: the interval is a list of every null value a two-sided test at α = 0.05 would not reject. You can read a whole family of tests off one interval.
Worked example — the Gentoo gap, how big? The test said the species differ. The interval says by how much.
- Build the margin. With the conservative critical value 1.976, the margin is 1.976 × 58.81 ≈ 116.21 g.
- Build the interval. The interval for the difference runs from 1,375.35 − 116.21 = 1,259.14 g to 1,375.35 + 116.21 = 1,491.56 g. It excludes 0, which matches the rejection.
- Judge the size. Even the low end, 1,259.14 g, is about a third of a typical Adelie's mass, because 1,259.14 ⁄ 3,700.66 ≈ 0.34.
In words: Gentoo penguins like these outweigh Adelie penguins by somewhere around 1.26 to 1.49 kg on average. This difference is statistically significant and practically large. A p-value alone could never tell you that second part.
The critical value 1.976 belongs to 150 degrees of freedom. Software uses the slightly smaller value for about 249.6 degrees of freedom, so its interval is a fraction of a gram narrower at each end. Using 1.976 errs on the safe, wider side.
Worked example — a poll at two levels. Suppose a poll of 1,000 adults finds 54% support for a proposal.
- Test H₀: p = 0.5. The null standard error is √(0.25 ⁄ 1,000) ≈ 1.58 percentage points, so z (the z statistic) = (54 − 50) ⁄ 1.58 ≈ 2.53.
- At α = 0.05. 2.53 is beyond 1.960, so you reject H₀. The 95% interval is 54% ± 1.96 × 1.58 = 54% ± 3.1 points, from 50.9% to 57.1%, and it excludes 50%.
- At α = 0.01. 2.53 is inside 2.576, so you fail to reject H₀. The 99% interval is 54% ± 2.576 × 1.58 = 54% ± 4.07 points, from 49.93% to 58.07%, and it includes 50%.
In words: the same poll is significant at the 5% level and not significant at the 1% level, and the two intervals show exactly why. A campaign deciding whether it has majority support should report the interval, not only the verdict.
Misconception check — "a significant result is a big result". Students often treat a tiny p-value as proof of a large effect. It is tempting, because the penguin gap is both. But the p-value measures surprise, not size. A huge sample can make a tiny gap significant. The cure: whenever you report a test, report the interval too, and judge the size in the units of the problem.
Memory hook: the interval holds every claim the test would keep; nothing else.
9. Choose the right procedure
Four tests can feel like four separate recipes. They are really one recipe with two switches. Ask two questions, in this order.
- What kind of variable? A quantitative variable, such as a mass in grams, calls for a mean. A categorical variable, such as female or male, calls for a proportion.
- How many groups? One group compared with a claimed value, or two independent groups compared with each other.
| Question | One group versus a claimed value | Two independent groups |
|---|---|---|
| About a mean (quantitative variable) | one-sample t test | two-sample t test |
| About a proportion (categorical variable) | one-proportion z test | two-proportion z test |
Then ask a third question: do you want a yes-or-no verdict about a claim, or an estimate of how big? A verdict calls for a test. "How big" calls for an interval. Most good reports give both.
Worked example — matching questions to procedures. Run the two switches on this week's four penguin questions.
- Is the mean Adelie mass different from 4,000 g? One group, a mean: a one-sample t test.
- Do Gentoo and Adelie penguins differ in mean mass? Two groups, a mean: a two-sample t test.
- Is the share of female penguins different from 0.5? One group, a proportion: a one-proportion z test.
- Is the Adelie share different on Biscoe and Dream? Two groups, a proportion: a two-proportion z test.
The conditions still decide whether a procedure fits. On Week 13's 10-question guessing quiz, np = 10 × 0.25 = 2.5 is below 10, so a one-proportion z test is not appropriate; you use the binomial p-value instead. On a 100-question version, np = 25 and n(1 − p) = 75, so the z test fits.
In words: the table picks a procedure, and the conditions decide whether you may use it. A student choosing a test for a 10-question quiz would decide on the binomial, not on the z test.
Misconception check — "a proportion test works on any yes-or-no data". Students often run a one-proportion z test on a small sample because the data are yes-or-no. It is tempting, because the variable type matches the table. But the z test relies on a normal model for p̂, and that model needs at least 10 expected successes and 10 expected failures. The cure: check the large-counts condition before you trust a z statistic; when it fails, fall back on the binomial.
Memory hook: variable type, then groups, then conditions — not the other way around.
Key terms
- null value — The specific value of a parameter that the null hypothesis claims, written μ₀ for a mean or p₀ for a proportion; a test measures how far the sample result sits from it. (first used: 1. Run the one-sample t test: count standard errors to the claim)
- one-sample t test — A hypothesis test for a population mean when σ is unknown; it computes t = (x̄ − μ₀) ⁄ (s ⁄ √n) and reads it against a t distribution with n − 1 degrees of freedom. (first used: 1. Run the one-sample t test: count standard errors to the claim)
- t statistic — The test statistic for a mean or a difference in means: the number of standard errors between the sample result and the null value, read against a t distribution. (first used: 1. Run the one-sample t test: count standard errors to the claim)
- independent samples — Two samples in which the individuals in one group have no link to the individuals in the other, such as two species of birds weighed separately. (first used: 3. Compare two means: set up the two-sample t test)
- two-sample t test — A hypothesis test that compares the means of two independent groups by dividing the difference in sample means by the standard error of that difference and reading the result against a t distribution. (first used: 3. Compare two means: set up the two-sample t test)
- standard error of a difference in means — How much the difference between two independent sample means typically wobbles from sample to sample, found as the square root of s₁² ⁄ n₁ plus s₂² ⁄ n₂. (first used: 3. Compare two means: set up the two-sample t test)
- Welch's degrees of freedom — The degrees of freedom for a two-sample t procedure that does not assume equal population standard deviations; software computes and reports them, often as a decimal such as 249.6. (first used: 4. Read the software output: Welch's t and its degrees of freedom)
- one-proportion z test — A hypothesis test for a population proportion; it computes z = (p̂ − p₀) ⁄ √(p₀(1 − p₀) ⁄ n), with the null value inside the standard error, and reads z against the standard normal curve. (first used: 5. Test one proportion: is the split even?)
- two-proportion z test — A hypothesis test that compares the proportions of two independent groups by dividing the difference in sample proportions by a standard error built from the pooled proportion. (first used: 7. Compare two proportions: pool the samples under the null hypothesis)
- pooled proportion — The share of successes when two samples are combined, total successes divided by total sample size, used in a two-proportion z test because the null hypothesis says the two population proportions are equal. (first used: 7. Compare two proportions: pool the samples under the null hypothesis)
- duality of tests and intervals — The link between a two-sided test at level α and a confidence interval at level 1 − α: the test rejects a null value exactly when it lies outside the interval. (first used: 8. See tests and intervals as two views of one question)
Summary
- A one-sample t test counts standard errors from a claimed mean to the sample mean, with the sample size minus 1 degrees of freedom.
- Judge a mean with the standard error, not the standard deviation; averages wobble far less than single values.
- A two-sample t test divides the difference in means by the standard error of the difference; read Welch's degrees of freedom from the output.
- A one-proportion z test puts the null value inside the standard error and needs at least 10 expected successes and 10 expected failures.
- A two-proportion z test pools the counts from both samples under the null hypothesis.
- "Not significant" means the data are consistent with the null hypothesis, not that the null hypothesis is true.
- A two-sided test at the 0.05 level rejects exactly the values outside the 95% interval, and the interval shows how big the effect is.
- Choose a procedure by the type of variable and the number of groups, then check the conditions before you compute.
Check your understanding
Work these before looking at the answers — they are ungraded, and the answers (with reasoning) are at the bottom of the page.
- A phone maker claims its battery lasts 20 hours on average. A consumer group tests a random sample of 25 phones and finds a mean of 19.2 hours with a sample standard deviation of 2.0 hours. Test the claim against a two-sided alternative at α = 0.05, and say what the result means.
- A website shows two versions of a sign-up page to separate random groups of 400 visitors each. Version A gets 60 sign-ups and version B gets 90. Carry out a two-proportion z test at α = 0.05.
- Name the right procedure for each question: (a) Do patients at two clinics differ in mean wait time? (b) Is the share of commuters who bike to work different from 10%? (c) Is the mean length of a city's bus rides different from 25 minutes?
- A study compares the mean commute time on two train lines and reports a p-value of 0.40. A friend says, "So the two lines take exactly the same time." What would you tell your friend?
Answers (worked reasoning — read after attempting)
- The hypotheses are H₀: μ = 20 hours and Hₐ: μ ≠ 20 hours. The standard error is 2.0 ⁄ √25 = 2.0 ⁄ 5 = 0.4 hours. The t statistic is (19.2 − 20) ⁄ 0.4 = −0.8 ⁄ 0.4 = −2.0, with df = 25 − 1 = 24. The critical value t* for 95% with df = 24 is 2.064, and the size of t, 2.0, is slightly inside it, so you fail to reject H₀. The data do not give convincing evidence that the mean battery life differs from 20 hours. That is not proof the claim is right: the 95% interval, 19.2 ± 2.064 × 0.4 = 19.2 ± 0.83, runs from 18.37 to 20.03 hours, so a mean a bit under 19 hours is also plausible. A buyer deciding on this phone should treat 20 hours as an optimistic but not disproven figure.
- The shares are 60 ⁄ 400 = 15% and 90 ⁄ 400 = 22.5%, a difference of −7.5 percentage points. Pool the counts: (60 + 90) ⁄ (400 + 400) = 150 ⁄ 800 = 18.75%. For the standard error, multiply the pooled share by its complement and by (1 ⁄ 400 + 1 ⁄ 400), then take the square root: about 2.76 percentage points. Then z = −7.5 ⁄ 2.76 ≈ −2.72. The size of z is beyond 1.960, so you reject H₀ at α = 0.05; it is also beyond 2.576, so the result holds at α = 0.01. All four counts (60, 340, 90, 310) are at least 10, so the z test fits. Version B wins a larger share of sign-ups.
- (a) Two groups and a mean: a two-sample t test. (b) One group and a proportion compared with a claimed value: a one-proportion z test. (c) One group and a mean compared with a claimed value: a one-sample t test.
- Tell your friend that a p-value of 0.40 means the data are consistent with no difference, not that the difference is exactly zero. If the lines had the same mean, a gap at least this large would show up in about 40% of studies, so the study cannot tell a small difference from none. A confidence interval for the difference would show how big a gap is still plausible.
Next up in this module: the Readings & Resources page, the lecture tutorial, the practice set, and the quiz — and next week the same test logic checks whether a regression line's slope is real.
Built with The Course Maker · samples.thecoursemaker.com