📖 Contents · Hub · Full version Chapter 10 · Hypothesis Testing
Statistics Easy Read · Chapter 10

The Logic of Hypothesis Testing

Every interesting result comes with a nagging question: could that have happened by chance? A hypothesis test is a formal, honest way to answer it. You write down the boring explanation and ask how surprising your data would be if that boring explanation were true. Then you let the answer guide your decision, without letting it dictate. The machinery is simple math, but the reasoning is where people get lost, and where careless researchers publish nonsense. This chapter is about the reasoning. It covers what a null hypothesis really claims, what a p-value really measures and what it plainly does not measure. It covers the two ways a test can be wrong. And it shows why a "significant" finding can still be worth nothing at all.

By the end of this chapter you can

  • State a null hypothesis and an alternative hypothesis correctly, in terms of population parameters.
  • Choose between a one-tailed and a two-tailed alternative, and explain why the choice comes before the data.
  • Define the p-value as a conditional probability, and work one out from a test statistic.
  • Name the three or four things a p-value is often and wrongly said to mean.
  • Use a significance level (α) to reach a decision, and use the words reject and fail to reject exactly.
  • Tell a Type I error from a Type II error, and work out the power of a simple test.
  • Explain how sample size drives p-values, and why huge studies find tiny effects "significant."
  • State and check the assumptions a test rests on, and explain why a p-value depends on those too.
  • Report a result using an effect size and a confidence interval, and read that interval correctly.
  • Explain why a significant result does not by itself prove causation.

Section 1Null and alternative hypotheses

Two overlapping distributions showing the null hypothesis distribution and the alternative hypothesis distribution
Reference. The null distribution and the alternative distribution side by side. A hypothesis test asks which world your data look like they came from. Source and license: see the figure credits

The courtroom, and why we start with the boring explanation

A hypothesis test is built like a criminal trial. The defendant is presumed innocent, and the prosecution must bring evidence strong enough to overturn that presumption. In statistics, the presumption of innocence is called the null hypothesis, written H0. It is always the dull, no news, nothing special explanation. The drug does nothing, the two groups are the same, the coin is fair or the population mean is just what everyone has always said it is.

Against it stands the alternative hypothesis, written Ha (some books write H1). This is the claim you truly care about: the drug helps, the groups differ, the coin is loaded or the mean has shifted. Notice the imbalance: the burden of proof sits fully on Ha. If the evidence is weak, we do not conclude that H0 is true. We simply say the prosecution failed. That imbalance is the most important idea in this chapter, and Section 3 comes back to it.

Writing them correctly: four rules

Most errors in stating hypotheses are mechanical, and four rules fix nearly all of them.

Rule 1: hypotheses are about parameters, never statistics. A hypothesis is a claim about the unknown population. It may be about μ (a population mean), p (a population proportion), σ (a population standard deviation) or the difference between two of those. It is never a claim about x̄ or the sample proportion p̂, because you can see those, so there is nothing to guess. Writing "H0: x̄ = 20" is like making a guess about a number already printed in front of you.

Rule 2: the equals sign lives in H0. The null must pin the parameter to one exact value, because that value is what lets us build a probability model and work out anything at all. So write H0: μ = 20, never H0: μ ≠ 20.

Rule 3: H0 and Ha must not overlap. Together, they should cover the choices without both being true at once, as in μ = 20 versus μ ≠ 20, or μ ≤ 20 versus μ > 20.

Rule 4: the direction is chosen before you look at the data. A two-tailed (two sided) alternative, μ ≠ 20, says "different in either direction." A one-tailed (one sided) alternative, μ > 20 or μ < 20, says "different in this one direction." It is only fair when the direction was decided ahead of time for a real reason, and when a difference the other way would be of no interest at all. Peeking at the data, noticing that the sample mean came out high and then declaring a one-tailed test is a way of quietly doubling your chance of a false positive. When in doubt, go two-tailed.

Research questionH0HaTails
Is the mean commute still 20 minutes?μ = 20μ ≠ 20Two
Does the new curriculum raise scores above the old mean of 72?μ ≤ 72μ > 72One (upper)
Is the defect rate below the promised 3%?p ≥ 0.03p < 0.03One (lower)
Do two teaching methods differ in mean score?μ1 − μ2 = 0μ1 − μ2 ≠ 0Two
Is the coin fair?p = 0.5p ≠ 0.5Two

Setting up a real one

A transit office states that the mean one way trip for students at a large school is 20 minutes. You suspect it has crept upward, but you would also want to know if it had dropped, so you go two-tailed. You survey a random sample of n = 36 students and find x̄ = 22.4 minutes with s = 6.0 minutes.

The hypotheses, in the language of the population, are

H0: μ = 20 minutes   versus   Ha: μ ≠ 20 minutes.

Your sample came out 2.4 minutes high. That by itself proves nothing, since samples wobble. The question the rest of this chapter answers is this: if the mean really were 20, how often would a sample of 36 wobble this far? We carry this example through Sections 2, 3 and 4.

You can never "prove the null." A test can give evidence against H0. But no amount of unremarkable data proves that a parameter equals exactly 20.000… . Absence of evidence is not evidence of absence. That is most true with a small sample, where you might have missed a real difference fully. That is why the verdict is "not guilty," not "innocent."
Interactive Write H₀ and Hₐ for six real claims, choosing the parameter, the null value, and the direction, and watch the null curve slide, the shaded tail flip, and the p-value recompute live, then see what it costs to pick the direction after looking at the data. Open full ↑
Key points
  • H0 is the no effect, no difference explanation. Ha carries the claim and the burden of proof.
  • Hypotheses are statements about parameters (μ, p, σ), never about sample statistics.
  • The equality goes in H0, because a fixed value is what makes the probability math possible.
  • Choose one-tailed vs two-tailed before seeing the data. When unsure, use two-tailed.

Section 2The p-value

A distribution curve with the tail area beyond the observed test statistic shaded to represent the p-value
Reference. The p-value as a shaded tail area: the probability, under H0, of a result at least as extreme as the one seen. Source and license: see the figure credits

What it actually measures

Assume, for the sake of argument, that H0 is true. Under that assumption, the sample statistic has a known sampling distribution, a pattern of wobble you can predict. The p-value is the probability, worked out inside that assumed world, of getting a result at least as extreme as the one you actually got.

Written as a conditional probability, it is:

p = P( a test statistic at least this extreme  |  H0 is true and the model's assumptions hold )

Read the vertical bar as "given." Everything to the right of it is assumed, not concluded. A small p-value means your data would be a rare event in the null world, which gives grounds for doubting the null world. A large p-value means your data are perfectly ordinary there. They are unsurprising, and so they tell you little.

Computing one, step by step

Back to the trips: H0: μ = 20 and Ha: μ ≠ 20, with n = 36, x̄ = 22.4 and s = 6.0.

Step 1: standard error. The typical wobble of a sample mean is

SE = s / √n = 6.0 / √36 = 6.0 / 6 = 1.00 minute.

Step 2: test statistic. Measure the gap between what you saw and what H0 predicted, in units of that wobble:

t = (x̄ − μ0) / SE = (22.4 − 20) / 1.00 = 2.40, with df = n − 1 = 35.

Your sample mean sits 2.40 standard errors above the null value.

Step 3: tail area. On a t distribution with 35 degrees of freedom, the area beyond t = 2.40 in one tail is about 0.011. Ha is two sided, so "at least as extreme" also includes results 2.40 SEs below 20. So we double it:

p ≈ 2 × 0.011 = 0.022.

Step 4: say it in plain English. Say the true mean trip really were 20 minutes. Then about 2.2% of random samples of 36 students would land at least 2.4 minutes away from 20, in one direction or the other. Our sample is in that unusual 2.2%. That is real evidence against μ = 20, but not overwhelming evidence.

What that calculation assumed

Every number above depends on a set of assumptions. A one sample t test has three that you must state and check before reporting anything:

The same three conditions carry through Sections 3, 4 and 5. When σ is known and used in place of s, as in the power math of Section 4, the test statistic becomes a z instead of a t. But the sampling, independence and shape rules do not change.

Four things a p-value is not

These misreadings are so common that they show up in press releases, textbooks and published papers. Learn them as a list of things you will never say.

People sayWhy it is wrongWhat is actually true
"p = 0.022, so there is a 2.2% chance the null is true."Reverses the conditioning. The p-value is P(data | H0), not P(H0 | data).P(H0 | data) cannot be computed without prior probabilities; classical testing never supplies them.
"There is a 97.8% chance the alternative is true."Same reversal, mirrored. 1 − p is not the probability of Ha.1 − p is just the area of the null distribution outside the tail. It says nothing about Ha.
"p = 0.022 means the effect is big."This mixes up evidence with size. A tiny effect gets a small p-value if n is huge.Magnitude is reported by an effect size and a confidence interval (Section 5).
"p = 0.022 means it will replicate 97.8% of the time."The chance of a repeat result depends on the true effect and the new study's power, not on p.A study with p just under 0.05 often replicates barely half the time.
"p = 0.30 proves there is no effect."A large p-value is a failure to detect, not a demonstration of absence.An underpowered study returns large p-values even when the effect is real (Section 4).

One more caution hides in the fine print of the definition. The p-value assumes H0 and every model assumption: random sampling, independence, the right shape of distribution and no picking and choosing of which results to report. A small p-value is evidence that something in that whole package is wrong. If your sample was a convenience sample of your friends, the thing that is wrong may not be H0.

The bar in P(A | B) points one way. The probability that someone is a professional basketball player, given that they are over 7 feet tall, is high. The probability that someone is over 7 feet tall, given that they are a professional basketball player, is a very different number. A p-value is the second kind of statement, about your data. People habitually read it as the first kind of statement, about your hypothesis.
Interactive Drag your result along the null distribution to shade the tail and watch the p-value recompute, then run thousands of simulated studies in a world where the null is true and count the extreme ones yourself. Open full ↑
Key points
  • The p-value is P(result this extreme or more | H0 true and assumptions hold).
  • Work it out in three moves: standard error → test statistic → tail area. Double the tail for a two sided Ha.
  • It is not the probability that the null is true, not the probability of a repeat result and not a measure of effect size.
  • A small p-value puts the whole model in doubt, not just H0, so check your sampling and assumptions first.

Section 3Significance and decisions

A normal curve divided into a central non-rejection region and shaded rejection regions in the tails
Reference. Rejection regions in the tails versus the region in the middle where you do not reject. This is the shape behind a significance level. Source and license: see the figure credits

Alpha: an error budget you set in advance

A p-value is a sliding (continuous) measure of surprise. Sooner or later, though, somebody has to do something: approve the drug, change the course plan or keep the old machine. Turning a sliding measure into a yes or no decision takes a cutoff, and that cutoff is the significance level, written α.

α is not a law of nature. It is a choice about how much risk of a false alarm you are willing to accept. Setting α = 0.05 means this: if H0 is true, I accept a 5% chance of wrongly rejecting it. Fields that can afford a few false alarms use 0.05. Some fields use 0.01, 10−6 or smaller. These are fields where a false alarm is a disaster, or where thousands of tests are run at once, such as genetics and particle physics. The one rule you cannot bend is that α is fixed before you see the data. Choosing α after the p-value arrives is not statistics; it is bookkeeping in reverse.

The decision rule, both ways

The rule itself is one line: if p ≤ α, reject H0; if p > α, fail to reject H0. Another route that gives the same answer compares the test statistic with a critical value instead. That is the picture the figure above shows. The tails cut off by α form the rejection region, and a statistic landing there leads to rejection.

Here is our trip study, with α = 0.05 set ahead of time:

The p-value route. p ≈ 0.022. Since 0.022 ≤ 0.05, reject H0.

The critical value route. With df = 35 and a two-tailed α = 0.05, the critical value is t* = 2.030. So the rejection region is t < −2.030 or t > 2.030. Our t = 2.40 lands beyond 2.030, so we reject H0. The verdict has to be the same, because the two routes are the same statement seen from two sides.

Now say the sample mean had been 21.6 instead of 22.4. Then

t = (21.6 − 20) / 1.00 = 1.60, and with df = 35 the two-tailed p ≈ 0.119.

Here 0.119 > 0.05, and 1.60 does not reach 2.030, so we fail to reject H0. Note with care what we have and have not learned. The sample mean was still 1.6 minutes above 20. We have not shown that the trip is 20 minutes. We have shown that a wobble this size is unremarkable in a sample of 36. So this study cannot tell the difference between "no change" and "a change we were too small to detect."

Say it right

OutcomeSay thisNever say this
p ≤ α"Reject H0." / "The result is statistically significant at α = 0.05.""Ha is proven." / "The null is false."
p > α"Fail to reject H0." / "There is insufficient evidence of a difference.""Accept H0." / "We proved there is no difference."
Any outcomeReport the estimate, the interval, and the exact p-value."p < 0.05" with no effect size.
p = 0.051"Weak evidence; the interval runs from … to …""No effect." / "Trending toward significance."

Why the fuss about "fail to reject" instead of "accept"? Because the test was never designed to gather evidence for H0. The whole setup, with its sampling distribution, tail area and rejection region, was built inside the assumption that H0 is true. So it can only ever tell you whether that assumption strains, and it has no way to confirm it. A jury that acquits has not proven innocence; it has found the evidence too weak.

0.049 and 0.051 are the same result. α = 0.05 is a habit, not a cliff. Two studies on opposite sides of it differ by an amount no scientist could care about. Yet one gets called "significant" and the other "null." Treat α as a decision rule for when you must act. Treat the p-value itself as what it is: a sliding, and rather noisy, measure of surprise.
Interactive Drag the significance level across a live two-tailed z-test and watch one unchanged p-value flip from "fail to reject" to "reject": then see the long-run error rate that your choice of alpha actually buys. Open full ↑
Key points
  • α is the false alarm rate you agree to accept, chosen before the data arrive.
  • The decision rule: p ≤ α → reject H0 and p > α → fail to reject. The critical value route always agrees.
  • "Fail to reject" ≠ "accept," because the test cannot give evidence in favor of the null.
  • Significance is crossing a cutoff, not a measurement. Report the estimate and interval alongside it.

Section 4Type I and Type II errors

Two overlapping distributions with shaded areas labeled for significance level and statistical power
Reference. Significance level and power drawn together. The null distribution's tail is α, the alternative distribution's overlap is β, and what remains is power. Source and license: see the figure credits

Two ways to be wrong

Reality has two states and your test has two verdicts, so there are four combinations: two right and two wrong.

 H0 is actually trueH0 is actually false
Reject H0Type I error: false alarm. Probability = α.Correct decision. Probability = 1 − β = power.
Fail to reject H0Correct decision. Probability = 1 − α.Type II error: missed detection. Probability = β.

A Type I error is convicting the innocent: declaring an effect that is not there. You control it directly, because α is its probability. That is what setting α = 0.05 buys you. A Type II error is letting the guilty go free: missing an effect that truly is there. Its probability, β, is not something you set directly. It falls out of how big the real effect is, how noisy your measurements are, how large your sample is and what α you chose.

Power is the good half of that second column. Power = 1 − β, the probability that your study detects an effect of a given size when that effect is real. Power belongs to a study design plus one named alternative. There is no such thing as "the power of a test" without naming the effect size you want to catch.

Computing power, with numbers

Go back to the trip study. To keep the math clean, say the population standard deviation is known to be σ = 6.0 minutes, so we can work with the standard normal. Test H0: μ = 20 against Ha: μ ≠ 20 at α = 0.05 with n = 36. Ask: if the true mean is really 21.5 minutes, what is the chance that we detect it?

Step 1: find the rejection region in real units. SE = σ/√n = 6.0/6 = 1.00. A two-tailed α = 0.05 uses z* = 1.96, so we reject whenever

x̄ > 20 + 1.96(1.00) = 21.96   or   x̄ < 20 − 1.96(1.00) = 18.04.

Step 2: move into the true world. If μ = 21.5, then x̄ is centered at 21.5 with the same SE = 1.00. Standardize both edges against 21.5:

upper: z = (21.96 − 21.5)/1.00 = 0.46   →   P(Z > 0.46) = 1 − 0.6772 = 0.3228

lower: z = (18.04 − 21.5)/1.00 = −3.46   →   P(Z < −3.46) = 0.0003

Step 3: add. Power = 0.3228 + 0.0003 ≈ 0.32, so β ≈ 1 − 0.32 = 0.68.

Read that again, because it is sobering. Say the trip truly has risen by a minute and a half. This study of 36 people misses it about 68% of the time. Most of its "no significant difference" conclusions would be wrong.

Step 4: fix it with sample size. Make n four times as big, 144. Then SE = 6.0/√144 = 6.0/12 = 0.50, and we reject when x̄ > 20 + 1.96(0.50) = 20.98 (or below 19.02). Standardize against the true 21.5:

z = (20.98 − 21.5)/0.50 = −1.04   →   P(Z > −1.04) = 0.8508

The lower edge adds almost nothing, so power ≈ 0.85. Making n four times as big halved the standard error and took power from 32% to 85%. This is just what a power analysis does before a study is run. Pick the smallest effect worth detecting and a target power (0.80 is the usual floor). Then solve for the n you need.

The four levers, and the trade-off

LeverMove it this wayEffect on powerCost
Sample size nIncreaseRises: SE shrinks like 1/√nTime, money, participants
True effect sizeLarger real differenceRisesNot yours to choose
Variability σDecrease (better measurement, tighter design)RisesEffort, instrumentation
Significance level αIncrease (0.01 → 0.05)RisesMore Type I errors

The last row is the central tension of the whole framework. With everything else held fixed, the only way to make Type I errors rarer is to shrink the rejection region. That makes Type II errors more common, and the reverse is also true. You cannot cut both by adjusting α. The one lever that improves both at once is a bigger, cleaner sample. That is why sample size is the design question that matters most.

Which error is worse depends fully on context, and that is a judgment about results in the real world, not about statistics. Think of screening for a cancer that can be treated. There, a Type II error (missing a real case) is far worse than a Type I error (a false alarm settled by a follow up test). So screening tests are tuned on purpose toward high power. In a criminal trial, the system accepts many Type II errors on purpose to avoid Type I errors.

A result that is not significant, from a study with too little power, means almost nothing. Before you take "no difference was found" seriously, ask what effect the study could have detected. Say its power against a meaningful effect was 30%. Then its failure to find one tells you about as much as a coin flip. Reporting it as evidence of no effect is a real error.
Interactive Tap through the four-cell error matrix while three live sliders, sample size, true effect, and alpha, recompute the overlapping null and alternative distributions, a power curve, and 200 simulated studies, showing why a bigger sample cures misses but never false alarms. Open full ↑
Key points
  • Type I error = rejecting a true H0 (a false alarm). Its probability is exactly α.
  • Type II error = failing to reject a false H0 (a missed detection). Its probability is β.
  • Power = 1 − β, always stated against a named effect size. 0.80 is the usual minimum.
  • Lowering α raises β. Only a larger n or less variability improves both kinds of error at once.

Section 5Statistical versus practical significance

A point estimate shown with a confidence interval around it on a number line
Reference. A point estimate with its confidence interval. This is the report that answers "how big?", which a p-value alone never does. Source and license: see the figure credits

Sample size manufactures significance

Look once more at the test statistic, and notice what is in the denominator:

t = (x̄ − μ0) / (s/√n)

Hold the top number fixed, the same real difference, and let n grow. The bottom number shrinks toward zero, so t grows without limit and the p-value slides toward zero. Any difference from H0, no matter how tiny, becomes statistically significant at a large enough sample size. Statistical significance answers "can we tell this is not exactly zero?" It never answers "is it big enough to care about?"

A worked pair: the significant triviality and the invisible whale

Study A. A supplement company follows n = 40,000 people and records each one's weight change over six months. It tests H0: μ = 0 against a two sided alternative. The mean change is 0.20 pounds, with s = 10 pounds. (This is a single sample of 40,000 changes, so the one sample formula SE = s/√n applies. Comparing two separate groups would need the two sample standard error instead.)

SE = s/√n = 10/√40000 = 10/200 = 0.05

t = 0.20 / 0.05 = 4.00, giving p < 0.0001, which is wildly "significant."

95% confidence interval: 0.20 ± 1.96(0.05) = 0.20 ± 0.098 → (0.10, 0.30) pounds.

The effect size (Cohen's d) = difference / s = 0.20/10 = 0.02, which is negligible by any standard.

The interval is the punchline. We are confident the true effect is somewhere between a tenth and three tenths of a pound. It is real and it is not zero, but it is fully worthless to a person trying to lose weight. It is significant, and trivial.

Study B. A small trial follows n = 25 people over the same six months and tests the same H0: μ = 0. The mean weight change is 4.0 pounds, again with s = 10 pounds.

SE = 10/√25 = 10/5 = 2.00

t = 4.0/2.00 = 2.00, df = 24, two-tailed p ≈ 0.057, which is "not significant."

95% CI: 4.0 ± 2.064(2.00) = 4.0 ± 4.13 → (−0.13, 8.13) pounds.

The effect size d = 4.0/10 = 0.40, a small to moderate effect worth chasing.

Study B failed the α = 0.05 cutoff, but its interval fits with an eight pound benefit. The honest conclusion is not "the supplement does not work." It is "this study was too small to say." Study A is the more significant result and the less important one. Study B is the less significant result and the more promising one.

 Practically importantPractically trivial
Statistically significantThe goal: a real, meaningful effect, well measured.Huge n detecting a difference nobody would act on (Study A).
Not statistically significantPromising but underpowered: wide interval, needs a bigger study (Study B).Genuinely uninteresting, or genuinely no effect. The interval tells you which.

What to report instead

A complete result has three parts, and only the third is the p-value. They are the estimate (how big), the interval (how exactly we know it) and the test (how surprising it would be under the null). Study A, reported properly, reads: "0.20 lb, 95% CI (0.10, 0.30), d = 0.02, p < 0.0001." No reader is fooled for a second.

A fourth caution belongs with the other three, because it is the one most likely to end up in a headline. A significant test result does not prove that anything caused anything. A claim about cause gets its strength from the design, not from the size of a test statistic. That means assigning people at random, having a control condition and controlling for confounding variables. Study A's people chose to take a supplement. Whatever sets them apart from people who did not may also set them apart in diet, income or exercise, and the p-value cannot tell those explanations apart. The same rule holds for a link seen between two measured variables. A small p-value on a correlation says the link is unlikely to be zero, and nothing more. Significance answers "can this pattern be told apart from noise?" Only the design answers "why is the pattern there?"

One last point about precision, because it is misstated all the time. A 95% confidence interval is a statement about the method, not about this one interval. It means this: if you repeated the whole study endlessly and built an interval each time by this method, about 95% of those intervals would contain the true parameter. It does not mean there is a 95% probability that the true parameter lies inside the interval you just worked out. That interval either contains μ or it does not, because the parameter is a fixed number, not a random one. The 95% describes how reliable the machine that made it is over the long run.

Ask "how big?" before you ask "is it significant?" Decide ahead of time what difference would be large enough to change what you do. That is the minimum important difference. Then check whether your confidence interval rules it out. A test tells you whether zero is believable. Only the interval tells you whether the effect clears the bar you truly care about.
Interactive Hold a trivially small true drug effect fixed and slide the sample size from 10 to 500,000: a live two-tailed z-test drives p below 0.05 and on to 10⁻¹²³, while the overlapping population curves, Cohen's d, and the confidence interval show the effect never became worth treating. Open full ↑
Key points
  • Because SE = s/√n, large samples make any difference that is not zero statistically significant.
  • Statistical significance answers "not zero?" Practical significance answers "big enough to matter?"
  • Report an effect size and a confidence interval alongside the p-value, never the p-value alone.
  • A 95% CI describes how often the method succeeds over the long run, not a 95% probability for this one interval.
  • Significance never proves causation. That comes from randomization and control in the design, not from the p-value.

The chapter in one breath

  • H0 is the no effect explanation, and it carries the equality. Ha is your claim, and it carries the burden of proof. Both are statements about parameters, and the number of tails is chosen before you look.
  • The p-value is P(a result this extreme or more | H0 true and assumptions hold). It is worked out as the standard error, then the test statistic, then the tail area.
  • A p-value is not the probability that the null is true, not the probability of a repeat result and not a measure of how big the effect is.
  • α is a false alarm budget fixed ahead of time. p ≤ α means reject H0, and p > α means fail to reject, never "accept."
  • A Type I error (probability α) is a false alarm, and a Type II error (probability β) is a miss. Power = 1 − β is stated against a named effect size.
  • Shrinking α raises β, and the reverse. Only a larger n or less variability improves both, which is why power analysis comes before data collection.
  • Because SE shrinks with √n, a large enough study makes any trivial difference "significant," and a small study can miss a large one.
  • Every p-value depends on the test's assumptions as well as on H0: random sampling, independence and close enough to normal. State and check them before reporting.
  • Report the estimate, the confidence interval and the effect size. A 95% CI describes how the method behaves over the long run, not this interval's chance of being right.
  • Statistical significance is never evidence of causation. Only the design, meaning randomization, control and handling of confounders, can support a claim about cause.

ReferenceWords worth knowing

A quick reference for the words in this chapter. The definitions are worded to be exact, not casual, because in hypothesis testing the casual wording is most often the wrong one.

Alpha (α, significance level)
The highest probability of a Type I error you agree to accept, fixed before the data are seen. It is most often 0.05, but the value should suit how costly a false alarm would be.
Alternative hypothesis (Ha)
The statement about a population parameter that goes against H0 and states the claim being studied. It may be two sided (≠) or one sided (> or <).
Assumptions (of a test)
The conditions a test's math depends on. For a one sample t test, they are random sampling, independent observations and a sampling distribution close enough to normal. A p-value depends on these as well as on H0, so they must be stated and checked before the result is reported.
Beta (β)
The probability of a Type II error: failing to reject a false H0. It is not set directly. It depends on the effect size, variability, sample size and α.
Confidence interval
A range of parameter values made by a method that, used again and again, catches the true parameter a stated share of the time (for example, 95%). It measures precision, not the probability for one interval.
Critical value
The cutoff on the test statistic's null distribution that marks the edge of the rejection region for a given α. An example is z* = 1.96 for a two-tailed test at α = 0.05.
Effect size
A measure of how big a difference or relationship is, which does not depend on sample size. An example is Cohen's d, the mean difference divided by the standard deviation.
Fail to reject
The verdict when p > α: the evidence is too weak to overturn H0. It is not a conclusion that H0 is true.
Null hypothesis (H0)
The default statement of no effect, no difference or no change. It is pinned to one parameter value so that a sampling distribution can be built.
One-tailed (one-sided) test
A test whose alternative names a direction, so the whole rejection region sits in one tail. It is fair only when the direction is chosen ahead of time for real reasons.
Parameter
A fixed number that describes a population, such as μ, σ or p. Hypotheses are always about parameters.
Power
1 − β: the probability of correctly rejecting H0 when a named alternative is true. It rises with a larger n, larger true effects, less variability and a larger α.
Practical significance
Whether an effect is large enough to matter in the real world, judged against a minimum important difference. It is a separate question from statistical significance.
p-value
The probability, assuming H0 and all model assumptions are true, of getting a test statistic at least as extreme as the one seen.
Rejection region
The set of test statistic values, set by α, that lead to rejecting H0. It is the shaded tail area or areas of the null distribution.
Sampling distribution
The distribution a statistic would follow across all possible samples of a given size. It is the math object that makes a p-value possible to work out.
Standard error (SE)
The standard deviation of a sampling distribution. For a mean, SE = s/√n (or σ/√n when σ is known).
Statistic
A number worked out from a sample, such as x̄ or s. It is used to estimate a parameter and to test hypotheses about it.
Statistically significant
Describes a result whose p-value falls at or below the α set ahead of time. It means the data would be unusual if H0 were true, and it says nothing about size.
Test statistic
A standardized measure of the distance between the data seen and what H0 predicts, in standard errors. An example is t = (x̄ − μ0)/(s/√n).
Two-tailed (two-sided) test
A test whose alternative is simply "different," splitting the rejection region between both tails. It is the safe default when no direction was named beforehand.
Type I error
Rejecting H0 when it is actually true: a false positive. Its probability is exactly α.
Type II error
Failing to reject H0 when it is actually false: a false negative, or missed detection. Its probability is β.

Check yourself

1. A maker claims its bags average 500 grams. You suspect underfilling. Write H0 and Ha, and say how many tails you would use and why.
H0: μ ≥ 500 grams; Ha: μ < 500 grams; one-tailed (lower). The suspicion of underfilling points one way, and it is stated before the data are collected. Overfilling would not be a complaint. So a lower one-tailed test is fair. Note that the hypotheses are about μ, the population mean, and the equality lives on the null side.
2. What is wrong with writing "H0: x̄ = 500"?
Hypotheses must be about parameters, not statistics. You already know x̄, since you worked it out from your sample, so there is nothing to guess. The unknown amount is the population mean μ, and that is what H0 must be about.
3. A study reports p = 0.03. A coworker says, "So there is a 3% chance the null hypothesis is true." Correct them exactly.
The p-value is P(data this extreme or more | H0 true), not P(H0 true | data). It says that if the null were true, results this extreme would occur about 3% of the time. Working out the probability that H0 is true would need prior probabilities, which classical hypothesis testing never supplies.
4. A sample of n = 64 gives x̄ = 103 with s = 16, testing H0: μ = 100 two sided. Work out the SE and the test statistic.
SE = 16/√64 = 16/8 = 2.00; t = (103 − 100)/2.00 = 1.50 with df = 63. The sample mean sits 1.5 standard errors above the null value. The two-tailed p-value is about 0.14, so at α = 0.05 you would fail to reject H0.
5. Why do we say "fail to reject H0" instead of "accept H0"?
The whole calculation is done inside the assumption that H0 is true. So the test can only detect strain on that assumption, and it has no way to confirm it. A large p-value may mean there is no effect. Or it may mean the study was too small to detect a real one. Like a jury that acquits for lack of evidence, we decline to convict without declaring innocence.
6. Define Type I and Type II errors, and give the probability of each.
Type I = rejecting a true H0 (false positive), with probability α. Type II = failing to reject a false H0 (false negative), with probability β. You set α directly. β follows from the effect size, variability, sample size and α.
7. A researcher lowers α from 0.05 to 0.01 to be "more careful." What happens to the two error probabilities, and to power?
The Type I error probability falls to 0.01, but β rises and power falls. Shrinking the rejection region makes false alarms rarer and missed detections more common. The only lever that improves both at once is a larger sample (or less noise in measuring).
8. Test H0: μ = 20 against a two sided alternative with σ = 6, n = 36 and α = 0.05. The rejection region is x̄ > 21.96 or x̄ < 18.04. If the true mean is 21.5, what is the power?
About 0.32. SE = 6/√36 = 1.00. Standardize the upper edge against the true mean: z = (21.96 − 21.5)/1.00 = 0.46, and P(Z > 0.46) = 0.3228. The lower edge gives z = −3.46, adding about 0.0003. Power ≈ 0.32, so β ≈ 0.68. The study misses this effect about two thirds of the time.
9. In Question 8, the sample size is raised to n = 144. Show why power rises to about 0.85.
SE = 6/√144 = 0.50, so the upper cutoff becomes 20 + 1.96(0.50) = 20.98. Standardizing against 21.5 gives z = (20.98 − 21.5)/0.50 = −1.04, and P(Z > −1.04) = 0.8508. Making n four times as big halved the standard error. That pulled the cutoff much closer to the true mean and raised power from 32% to about 85%.
10. A single sample of n = 40,000 people has a mean weight change of 0.20 lb with s = 10 lb, tested against H0: μ = 0, and reports p < 0.0001. Work out the 95% CI and Cohen's d, then explain what they mean.
SE = 10/√40000 = 0.05; CI = 0.20 ± 1.96(0.05) = (0.10, 0.30) lb; d = 0.20/10 = 0.02. The effect is real and measured exactly, but it is negligible: a tenth to three tenths of a pound, with an effect size of 0.02. This is statistical significance without practical significance, made by a huge sample.
11. A study with n = 25 finds a mean weight change of 4.0 lb, s = 10 lb, p ≈ 0.057 and a 95% CI of (−0.13, 8.13). Is "the treatment does not work" a fair conclusion?
No. The result is not significant, but the interval fits with a benefit of up to about 8 pounds. SE = 10/√25 = 2.00 and t = 4.0/2.00 = 2.00 with df = 24, so this simply failed to clear α = 0.05. With d = 0.40, the honest conclusion is that the study was too small to decide, not that the effect is absent.
12. State exactly what "95% confidence" means, and say what it does not mean.
It means that if the study were repeated over and over, with an interval built each time by this method, about 95% of those intervals would contain the true parameter. It does not mean there is a 95% probability that the parameter lies inside the one interval you worked out. The parameter is a fixed number, and that interval either contains it or it does not. The 95% is a trait of the method, not of this result.