Hypothesis Testing Fundamentals

A technician measures the lead content of a water sample five times. The mean is 15.4 µg/L, against a regulatory limit of 15.0 µg/L. Is the water actually contaminated? Or did ordinary measurement noise push the mean above the limit by chance? Hypothesis testing is the formal machinery that answers questions like this. It converts a vague feeling of "seems high" into a defensible probability statement. Every quantitative decision in analytical chemistry reduces to the same logical skeleton. This includes whether a new method agrees with a reference method. It includes whether a suspected outlier should be rejected. It also includes whether two labs report the same value. The skeleton works like this: propose a "nothing interesting is happening" hypothesis. Compute how surprising the data would be if that were true. Then decide whether the surprise is large enough to reject it. This skeleton is built on the The t Distribution. It underlies essentially every statistical tool used in a modern analytical laboratory. This spans calibration validation, method comparison, and regulatory compliance testing. The big picture is that a statistical test never proves anything is true. It only quantifies the risk of being wrong in one of two specific ways. These are falsely crying wolf, or failing to notice a real wolf. The analyst chooses, in advance, how much of each risk to tolerate. This is a philosophically different activity from curve-fitting or error propagation. It is a decision procedure with built-in, computable failure rates. This article builds the full logical apparatus. It covers the null and alternative hypotheses, and the significance level α\alpha. It covers the distinction between one-tailed and two-tailed tests. It also covers the two flavors of mistake — Type I and Type II error. Alongside these is the statistical power that controls how well a test can detect a real effect. Worked examples span a textbook case, an EPA-style regulatory decision, and a subtler exam-level problem. That last example involves a directional hypothesis and sample-size planning. This groundwork is what makes the Comparison of Means by t-test, The F-Test, and the Q-Test for Outliers rigorous rather than ad hoc.

Key takeaways
  • A hypothesis test starts with H0H_0 (no effect/no difference) and HaH_a (the effect exists), and asks whether data are inconsistent with H0H_0.
  • The significance level α\alpha is the probability of rejecting H0H_0 when it is actually true (Type I error), chosen before the data are examined — typically 0.05.
  • Two-tailed tests detect a difference in either direction; one-tailed tests detect a difference in one specified direction and are more powerful for that direction alone.
  • Type II error (β\beta) is failing to reject a false H0H_0; power =1−β= 1-\beta is the probability of correctly detecting a real effect.
  • α\alpha and β\beta trade off against each other for fixed nn; only increasing sample size (or effect size, or precision) improves both simultaneously.
  • The test statistic (e.g., tcalct_{calc}) is compared to a critical value from a reference distribution; if ∣tcalc∣>tcrit|t_{calc}| > t_{crit}, H0H_0 is rejected at the chosen α\alpha.
  • Key idea: a hypothesis test is a pre-agreed rule for converting the probability of your data under a "nothing happening" model into a yes/no decision, with known, controllable error rates.

Where this lives today

Regulatory environmental and pharmaceutical testing runs almost entirely on this framework: EPA methods for drinking-water contaminants, USP monographs for drug potency and content uniformity, and clinical laboratory quality control charts all embed a hypothesis test — usually one- or two-tailed tt-tests or their multivariate generalizations — behind every pass/fail decision. Method validation studies, required before any new analytical procedure can be adopted in a regulated lab, use hypothesis testing to demonstrate that a new method's mean and variance are statistically indistinguishable from a validated reference method, directly setting up the logic that the Comparison of Means by t-test develops in full, and that the The F-Test extends to comparing precision (variance) rather than accuracy (mean). In instrumental analysis, hypothesis testing governs limit-of-detection and limit-of-quantitation claims: a signal is only reported as "detected" if it is statistically distinguishable from the blank's noise distribution at a chosen confidence level, an application of exactly the one-tailed logic developed here (only signals above the blank matter). Chromatographic and spectroscopic data-processing software silently perform such tests every time a peak-detection algorithm decides whether a bump in the baseline is a real analyte peak or noise. Outlier rejection in a data set — deciding whether one anomalous replicate measurement should be discarded before averaging — is itself a hypothesis test in disguise, formalized by the Q-Test for Outliers, where H0H_0 is "the suspect point comes from the same population as the rest" and rejection requires the gap between it and its neighbor to exceed a tabulated critical ratio, precisely analogous to comparing tcalct_{calc} to tcritt_{crit} here. Beyond the analytical bench, the same apparatus underlies clinical trial design (is a new drug's effect distinguishable from placebo, with FDA-mandated α=0.05\alpha=0.05 two-tailed conventions), forensic science (is a questioned document's ink chemically distinguishable from a known standard), and quality engineering (statistical process control charts flag a manufacturing process as "out of control" using exactly the Type I/Type II error trade-off developed here, tuned so that false alarms are rare enough not to halt production needlessly while still catching genuine drift quickly).

Ask the tutor: How do I choose between a t-test, an F-test, and a Q-test when I have real replicate data with a suspicious outlier and want to compare two methods?

The physical picture — thorough prose

Consider the water-lead example concretely. The regulatory limit is μ0=15.0 μg/L\mu_0 = 15.0\ \mu\text{g/L}. Five replicate measurements give a sample mean xˉ=15.4 μg/L\bar{x} = 15.4\ \mu\text{g/L} with sample standard deviation s=0.5 μg/Ls = 0.5\ \mu\text{g/L}. The mean is above the limit — but by how much, relative to the noise? If the true population mean were exactly 15.0 (water is compliant) and we happened to draw this particular sample of five measurements, how often would we see a sample mean this far from 15.0 purely by chance? That question is answered by treating xˉ\bar{x} as one draw from a sampling distribution centered at μ0\mu_0 with spread s/ns/\sqrt{n}, and asking how far out in the tail 15.4 sits. Because σ\sigma is unknown and estimated by ss from a small sample, the relevant reference distribution is Student's tt with n−1n-1 degrees of freedom (heavier tails than a normal distribution, reflecting the extra uncertainty in estimating ss). The test statistic

tcalc=xˉ−μ0s/nt_{calc} = \frac{\bar{x} - \mu_0}{s/\sqrt{n}}

measures the discrepancy in units of standard error. Large ∣tcalc∣|t_{calc}| means the data are hard to reconcile with μ0\mu_0; small ∣tcalc∣|t_{calc}| means the deviation is well within the noise expected from chance alone. The essential logical move is that we never test whether HaH_a ("the water is contaminated") is true directly — we test whether H0H_0 ("the true mean equals the limit") can be rejected. This asymmetry is deliberate: H0H_0 is a precise, falsifiable statement (a single number, μ0\mu_0), while HaH_a is usually a vague range of alternatives ("μ≠15.0\mu \neq 15.0" or "μ>15.0\mu > 15.0"). Falsifying a precise claim is tractable; "proving" a vague one is not. This is the same logical stance formalized by Ronald Fisher and later refined by Jerzy Neyman and Egon Pearson into the decision-theoretic framework used today.

Figure
Sampling distribution of the mean under H₀, with rejection region shaded
sample mean, x̄ (µg/L) μ₀ = 15.0 t_crit (α = 0.05) x̄ = 15.4 observed reject H₀ here shape: t-distribution, n − 1 = 4 df

The picture generalizes immediately to two-tailed versus one-tailed reasoning. If the analyst has no prior reason to expect the deviation in a particular direction — a new instrument might read high or low relative to a certified reference value — both tails of the distribution count as "surprising," and α\alpha is split between them (α/2\alpha/2 each side). If instead the question is specifically "is the water over the limit" (an increase in the wrong direction is the only thing that matters), all of α\alpha is placed in one tail, making the test more sensitive to that particular direction of deviation for the same α\alpha.

Figure
One-tailed vs two-tailed rejection regions for α = 0.05
Two-tailed (H₀: μ = μ₀) α/2 = 0.025 α/2 = 0.025 t at ±2.776 (n=5, df=4) One-tailed (H₀: μ ≤ μ₀) α = 0.05, one side t at +2.132 (n=5, df=4) Same α, different critical |t|: two-tailed needs a LARGER |t_calc| to reject one-tailed needs a SMALLER t_calc (correct direction) to reject

The final piece of the picture is that rejecting H0H_0 is not the only way to be wrong. A test can fail in two distinct directions: rejecting a true H0H_0 (a false alarm, Type I error, probability α\alpha), or failing to reject a false H0H_0 (a missed detection, Type II error, probability β\beta). These are not symmetric costs in practice — a clinical lab falsely flagging a healthy patient as diseased (Type I) has different consequences than missing a genuinely diseased patient (Type II) — and the choice of α\alpha, sample size, and one- vs. two-tailed structure are all levers the analyst controls to balance these risks for the problem at hand.

The core ideas — the governing equations/relationships

The test statistic for a sample mean against a fixed reference value, when σ\sigma is unknown (the usual case in the laboratory):

tcalc=xˉ−μ0s/nt_{calc} = \frac{\bar{x} - \mu_0}{s/\sqrt{n}}

where: xˉ\bar{x} = sample mean, μ0\mu_0 = hypothesized (reference) value under H0H_0, ss = sample standard deviation, nn = number of replicate measurements, and tcalct_{calc} has ν=n−1\nu = n-1 degrees of freedom.

Reading: tcalct_{calc} is the discrepancy between what was measured and what H0H_0 predicts, expressed in units of the standard error of the mean. It answers "how many standard errors away is my data from the null value?" The decision rule for a two-tailed test at significance level α\alpha:

Reject H0 if ∣tcalc∣>tcrit, ν, α/2\text{Reject } H_0 \text{ if } |t_{calc}| > t_{crit,\, \nu,\, \alpha/2}

where: tcrit, ν, α/2t_{crit,\,\nu,\,\alpha/2} is the critical value cutting off area α/2\alpha/2 in each tail of the tt-distribution with ν\nu degrees of freedom, read from a standard tt-table or computed numerically.

Reading: because either direction of deviation counts as evidence against H0H_0, the critical value must be exceeded in absolute value; the total false-alarm probability α\alpha is split evenly between the two tails. The one-tailed analogue, for Ha:μ>μ0H_a: \mu > \mu_0 (or symmetrically μ<μ0\mu < \mu_0):

Reject H0 if tcalc>tcrit, ν, α\text{Reject } H_0 \text{ if } t_{calc} > t_{crit,\,\nu,\,\alpha}

where: the entire α\alpha is placed in the single tail consistent with HaH_a, so tcrit, ν, αt_{crit,\,\nu,\,\alpha} is smaller in magnitude than the two-tailed tcrit, ν, α/2t_{crit,\,\nu,\,\alpha/2} for the same ν\nu and α\alpha.

Reading: a one-tailed test is more powerful for detecting a deviation in the anticipated direction, at the cost of being unable to detect (indeed, blind to) a deviation in the opposite direction — a choice that must be justified before seeing the data, never after. The relationship between the two hypotheses and the two error types, in tabular logical form:

H0 trueH0 falseReject H0Type I error (α)Correct: power (1−β)Fail to reject H0Correct (1−α)Type II error (β)\begin{array}{c|cc} & H_0 \text{ true} & H_0 \text{ false} \\ \hline \text{Reject } H_0 & \text{Type I error } (\alpha) & \text{Correct: power } (1-\beta) \\ \text{Fail to reject } H_0 & \text{Correct } (1-\alpha) & \text{Type II error } (\beta) \end{array}

Reading: α\alpha and β\beta are conditional probabilities on different rows of reality (true H0H_0 vs. false H0H_0) and are set independently — reducing one for fixed nn generally increases the other, which is why sample size is the third lever. The power of a test, and its dependence on the true effect size δ=μtrue−μ0\delta = \mu_{true}-\mu_0, sample size nn, and α\alpha:

Power=1−β=P(tcalc>tcrit | μ=μtrue)\text{Power} = 1-\beta = P\left(t_{calc} > t_{crit}\ \middle|\ \mu = \mu_{true}\right)

where: the calculation uses the noncentral tt-distribution centered on the true (nonzero) effect δ/(σ/n)\delta/(\sigma/\sqrt n) rather than on zero.

Reading: power grows as the true effect δ\delta grows, as nn grows (shrinking the standard error), or as α\alpha is relaxed (moving the critical value inward) — three independent knobs, all traded against the risk of a false positive.

Derivation AFrom a confidence interval to a hypothesis test

Goal. Show that the two-tailed tt-test decision rule is algebraically identical to asking whether μ0\mu_0 falls inside the (1−α)(1-\alpha) confidence interval for μ\mu — the two most common statistical tools in the lab are, in fact, one construction viewed two ways.

Step 1. Start from the confidence interval for the population mean. For a sample of nn measurements with mean xˉ\bar{x} and standard deviation ss, the standard (1−α)(1-\alpha) confidence interval, built on the The t Distribution, is

μ=xˉ±tcrit, ν, α/2 sn\mu = \bar{x} \pm t_{crit,\,\nu,\,\alpha/2}\,\frac{s}{\sqrt n}

This interval is a range of plausible values for the unknown true mean μ\mu, constructed so that in repeated sampling, the interval would contain the true μ\mu in a fraction (1−α)(1-\alpha) of trials.

Step 2. Ask whether μ0\mu_0 (the hypothesized value) lies inside that interval. The value μ0\mu_0 is "inside" precisely when

xˉ−tcritsn≤μ0≤xˉ+tcritsn\bar{x} - t_{crit}\frac{s}{\sqrt n} \le \mu_0 \le \bar{x} + t_{crit}\frac{s}{\sqrt n}

Step 3. Rearrange the inequality algebraically. Subtract xˉ\bar{x} from all three parts:

−tcritsn≤μ0−xˉ≤tcritsn-t_{crit}\frac{s}{\sqrt n} \le \mu_0 - \bar{x} \le t_{crit}\frac{s}{\sqrt n}

Divide every term by s/ns/\sqrt n (a positive quantity, so the inequality direction is preserved):

−tcrit≤μ0−xˉs/n≤tcrit-t_{crit} \le \frac{\mu_0-\bar x}{s/\sqrt n} \le t_{crit}

Multiply through by −1-1 (flipping both inequality directions) to recover the familiar test statistic:

−tcrit≤xˉ−μ0s/n≤tcrit⟺∣tcalc∣≤tcrit-t_{crit} \le \frac{\bar x - \mu_0}{s/\sqrt n} \le t_{crit} \quad\Longleftrightarrow\quad |t_{calc}| \le t_{crit}

Step 4. Interpret the equivalence. "μ0\mu_0 lies inside the confidence interval" is algebraically identical to "∣tcalc∣≤tcrit|t_{calc}| \le t_{crit}," i.e. to failing to reject H0H_0. Conversely, if μ0\mu_0 falls outside the confidence interval, then ∣tcalc∣>tcrit|t_{calc}| > t_{crit} and H0H_0 is rejected. The confidence interval and the two-tailed hypothesis test are the same calculation, packaged for two different questions: "what range of true values is consistent with my data?" versus "is this one specific value consistent with my data?"

Go deeper · Derivation B · 2 minWhy the one-tailed critical value is smaller than the two-tailed one, and what that does to power
Derivation BWhy the one-tailed critical value is smaller than the two-tailed one, and what that does to power

Goal. Derive, from the definition of α\alpha as tail area, why switching from a two-tailed to a correctly-directed one-tailed test lowers the critical tt-value and raises power for detecting an effect in that direction — while showing exactly where that gain is "borrowed" from.

Step 1. Write α\alpha as an area under the tt-density fν(t)f_\nu(t). For a two-tailed test, α\alpha is split symmetrically:

α=∫t2,crit∞fν(t) dt  +  ∫−∞−t2,critfν(t) dt=2∫t2,crit∞fν(t) dt\alpha = \int_{t_{2,crit}}^{\infty} f_\nu(t)\,dt \;+\; \int_{-\infty}^{-t_{2,crit}} f_\nu(t)\,dt = 2\int_{t_{2,crit}}^{\infty} f_\nu(t)\,dt

so each tail alone carries area α/2\alpha/2.

Step 2. Write the one-tailed condition. For Ha:μ>μ0H_a: \mu>\mu_0, all of α\alpha sits in the upper tail:

α=∫t1,crit∞fν(t) dt\alpha = \int_{t_{1,crit}}^{\infty} f_\nu(t)\,dt

Step 3. Compare the two tail areas for the same α\alpha. The two-tailed critical value satisfies ∫t2,crit∞fν=α/2\int_{t_{2,crit}}^\infty f_\nu = \alpha/2, a smaller tail area than the one-tailed condition's ∫t1,crit∞fν=α\int_{t_{1,crit}}^\infty f_\nu = \alpha. Since fν(t)f_\nu(t) is a decreasing function of tt for t>0t>0 and the cumulative tail integral is a strictly decreasing function of its lower limit, a smaller required tail area forces a larger cutoff:

t2,crit>t1,critt_{2,crit} > t_{1,crit}

For ν=4\nu=4 and α=0.05\alpha = 0.05: t2,crit=2.776t_{2,crit}=2.776 (two-tailed, each tail =0.025=0.025) while t1,crit=2.132t_{1,crit}=2.132 (one-tailed, tail =0.05=0.05) — the one-tailed threshold is closer to zero, hence easier to exceed.

Step 4. Translate into power. If the true mean is displaced by δ\delta so that tcalct_{calc} is drawn from a distribution centered at δn/s>0\delta\sqrt n/s > 0, then the probability of exceeding the smaller threshold t1,critt_{1,crit} is larger than the probability of exceeding t2,critt_{2,crit}:

P(tcalc>t1,crit)>P(tcalc>t2,crit)P(t_{calc}>t_{1,crit}) > P(t_{calc}>t_{2,crit})

so Powerone-tailed>Powertwo-tailed\text{Power}_{\text{one-tailed}} > \text{Power}_{\text{two-tailed}} for a true effect in the anticipated direction.

Step 5. Identify the hidden cost. The one-tailed test achieves this only by placing zero rejection region in the opposite tail. If the true effect had instead been in the unanticipated direction (μ<μ0\mu<\mu_0 when HaH_a specified μ>μ0\mu>\mu_0), the one-tailed test has no power at all to detect it — a real, possibly important deviation goes systematically unnoticed. The one-tailed test's power gain is not free; it is purchased by deliberately blinding the test to one entire direction of reality, which is why the direction must be scientifically justified in advance and never chosen after inspecting the data (a malpractice sometimes called "tail-switching" or, more broadly, p-hacking).

Worked examples

Example 1 — Foundational: is a new pH buffer at its stated value? A stock buffer is certified at pH =7.00= 7.00. A student measures it n=6n=6 times with a freshly calibrated pH meter and obtains

7.08, 6.95, 7.02, 7.10, 6.99, 7.067.08,\ 6.95,\ 7.02,\ 7.10,\ 6.99,\ 7.06

Test at α=0.05\alpha = 0.05 (two-tailed) whether the meter reads consistently with the certified value. Step 1 — sample statistics.

xˉ=7.08+6.95+7.02+7.10+6.99+7.066=42.206=7.033\bar x = \frac{7.08+6.95+7.02+7.10+6.99+7.06}{6} = \frac{42.20}{6} = 7.033

Deviations from the mean: 0.047,−0.083,−0.013,0.067,−0.043,0.0270.047, -0.083, -0.013, 0.067, -0.043, 0.027. Sum of squared deviations:

0.0472+0.0832+0.0132+0.0672+0.0432+0.0272=0.002209+0.006889+0.000169+0.004489+0.001849+0.000729=0.0163340.047^2+0.083^2+0.013^2+0.067^2+0.043^2+0.027^2 = 0.002209+0.006889+0.000169+0.004489+0.001849+0.000729 = 0.016334
s=0.0163346−1=0.0032668=0.05716s = \sqrt{\frac{0.016334}{6-1}} = \sqrt{0.0032668} = 0.05716

Step 2 — hypotheses.

H0:μ=7.00Ha:μ≠7.00(two-tailed — no reason to expect a specific direction)H_0: \mu = 7.00 \qquad H_a: \mu \ne 7.00 \quad(\text{two-tailed — no reason to expect a specific direction})

Step 3 — test statistic.

tcalc=7.033−7.000.05716/6=0.0330.02334=1.414t_{calc} = \frac{7.033 - 7.00}{0.05716/\sqrt 6} = \frac{0.033}{0.02334} = 1.414

Step 4 — critical value. With ν=n−1=5\nu = n-1 = 5 degrees of freedom, α=0.05\alpha = 0.05 two-tailed: tcrit,5,0.025=2.571t_{crit,5,0.025} = 2.571. Step 5 — decision. Since ∣tcalc∣=1.414<2.571=tcrit|t_{calc}| = 1.414 < 2.571 = t_{crit}, we fail to reject H0H_0. The data are consistent with the meter reading the certified pH of 7.00; the observed 0.033-unit offset is well within the noise expected from six replicate readings at this precision. Note carefully: this does not prove the meter is perfectly accurate — it only shows insufficient evidence, at this sample size and this α\alpha, to claim a bias.

Example 2 — Applied: EPA-style one-tailed test for a contamination limit Returning to the opening scenario: an environmental lab reports five replicate lead measurements on a water sample with a regulatory action limit of μ0=15.0 μg/L\mu_0 = 15.0\ \mu\text{g/L} (exceeding the limit triggers remediation — only high readings matter regulatorily):

15.8, 14.9, 15.6, 15.3, 15.4μg/L15.8,\ 14.9,\ 15.6,\ 15.3,\ 15.4 \quad \mu\text{g/L}

Test at α=0.01\alpha = 0.01 (chosen deliberately strict, since remediation is expensive and a false positive is costly) whether the water exceeds the limit. Step 1 — sample statistics.

xˉ=15.8+14.9+15.6+15.3+15.45=77.05=15.40 μg/L\bar x = \frac{15.8+14.9+15.6+15.3+15.4}{5} = \frac{77.0}{5} = 15.40\ \mu\text{g/L}

Deviations: 0.4,−0.5,0.2,−0.1,0.00.4, -0.5, 0.2, -0.1, 0.0. Sum of squares: 0.16+0.25+0.04+0.01+0.00=0.460.16+0.25+0.04+0.01+0.00 = 0.46.

s=0.464=0.115=0.3391 μg/Ls = \sqrt{\frac{0.46}{4}} = \sqrt{0.115} = 0.3391\ \mu\text{g/L}

Step 2 — hypotheses (directional, justified in advance by the regulatory question).

H0:μ≤15.0Ha:μ>15.0(one-tailed)H_0: \mu \le 15.0 \qquad H_a: \mu > 15.0 \quad(\text{one-tailed})

Step 3 — test statistic.

tcalc=15.40−15.000.3391/5=0.400.1517=2.637t_{calc} = \frac{15.40-15.00}{0.3391/\sqrt5} = \frac{0.40}{0.1517} = 2.637

Step 4 — critical value. ν=4\nu = 4, one-tailed α=0.01\alpha = 0.01: tcrit,4,0.01=3.747t_{crit,4,0.01} = 3.747. Step 5 — decision. Since tcalc=2.637<3.747t_{calc} = 2.637 < 3.747, we fail to reject H0H_0 at the strict 1% level — there is not yet statistically significant evidence of exceedance, despite the sample mean sitting numerically above the limit. This illustrates the central lesson of significance testing: a sample mean exceeding a threshold is not, by itself, sufficient evidence — the excess must be judged against the measurement noise, scaled by how confident (small α\alpha) the decision-maker demands to be. (Had the lab instead used α=0.05\alpha = 0.05, tcrit,4,0.05=2.132t_{crit,4,0.05}=2.132, and tcalc=2.637t_{calc}=2.637 would exceed it — rejecting H0H_0. This sensitivity to the chosen α\alpha is exactly why α\alpha must be fixed by policy before the data are collected, never adjusted afterward to force a convenient conclusion.)

Example 3 — Exam/competition level: sample size needed for adequate power A method-validation chemist wants to detect a bias of δ=0.30\delta = 0.30 mg/L in a spiked recovery study, where the historical standard deviation of replicate measurements is s=0.40s = 0.40 mg/L. Using a two-tailed test at α=0.05\alpha = 0.05, what minimum sample size nn is needed so that the test has power 1−β≥0.901-\beta \ge 0.90 to detect this bias if it truly exists? Step 1 — set up the noncentrality condition. Power ≥0.90\ge 0.90 requires that the noncentral tt-statistic, centered at

δnoncentrality=δns=0.30n0.40=0.75n\delta_{\text{noncentrality}} = \frac{\delta \sqrt n}{s} = \frac{0.30\sqrt n}{0.40} = 0.75\sqrt n

exceed the two-tailed critical value tcrit,ν,0.025t_{crit,\nu,0.025} with probability at least 0.90. For a normal-approximation planning calculation (adequate for an exam-level estimate, and exact enough to design the study before refining with iterative noncentral-tt tables), the standard sample-size formula is

n=((zα/2+zβ) sδ)2n = \left(\frac{(z_{\alpha/2}+z_\beta)\,s}{\delta}\right)^2

where: zα/2=1.960z_{\alpha/2}=1.960 (two-tailed 5% critical z-value) and zβ=1.282z_\beta = 1.282 (for 90% power, β=0.10\beta=0.10, one-sided). Step 2 — plug in numbers.

n=((1.960+1.282)(0.40)0.30)2=(3.242×0.400.30)2=(1.29680.30)2=(4.3227)2=18.69n = \left(\frac{(1.960+1.282)(0.40)}{0.30}\right)^2 = \left(\frac{3.242\times0.40}{0.30}\right)^2 = \left(\frac{1.2968}{0.30}\right)^2 = (4.3227)^2 = 18.69

Step 3 — round up (sample size must be an integer, and rounding down would undershoot the target power).

n=19n = 19

Step 4 — sanity check against the limiting case. As the required power →0.50\to 0.50 (β→0.50\beta \to 0.50, zβ→0z_\beta \to 0), the formula collapses to n=(zα/2 s/δ)2=(1.960×0.40/0.30)2≈6.8→7n = (z_{\alpha/2}\,s/\delta)^2 = (1.960\times0.40/0.30)^2 \approx 6.8 \to 7 — a much smaller study suffices if we only demand a coin-flip's chance of detecting the bias, confirming the formula behaves sensibly: demanding higher power costs more replicates, and the two terms zα/2z_{\alpha/2} (false-alarm control) and zβz_\beta (miss-rate control) enter additively inside the square, so tightening either one independently inflates nn. With n=19n=19 replicates planned, a subsequent real experiment would then use the exact tt-based (not zz-based) critical values with ν=18\nu=18 for the final significance decision, since zz is only an adequate stand-in for planning purposes at moderately large nn.

Limiting cases, scope & common traps

SituationBehaviorWhy
n→∞n \to \inftytcrit→zcritt_{crit} \to z_{crit}; test becomes a zz-testtt-distribution's extra tail weight (from estimating ss) vanishes as ν→∞\nu \to \infty
α→0\alpha \to 0tcrit→∞t_{crit} \to \infty; test essentially never rejects H0H_0Demanding near-zero false-alarm risk requires overwhelming evidence
α→1\alpha \to 1tcrit→0t_{crit} \to 0; test rejects almost anythingNo real protection against false positives
True effect δ=0\delta = 0Power →α\to \alphaWith no real effect, "detecting" one only happens at the false-positive rate
s→0s \to 0 (perfect precision)tcalc→±∞t_{calc} \to \pm\infty for any nonzero xˉ−μ0\bar x - \mu_0Even a tiny true difference becomes statistically significant with enough precision
One-tailed used post hocInvalid α\alphaChoosing the tail after seeing which side the data fell on secretly doubles the true false-positive rate

The chemist behind it

Hypothesis testing as used in analytical chemistry descends directly from the statistical framework built by Ronald Fisher and, in a rival but complementary form, by Jerzy Neyman and Egon Pearson. Fisher, working at the Rothamsted agricultural experiment station in the 1920s, needed a rigorous way to judge whether a new fertilizer treatment produced a real yield difference or one plausibly due to field-to-field variability — precisely the same logical problem as judging whether a new analytical method gives a real bias or one plausibly due to measurement noise. Fisher introduced the significance level and the p-value as tools for judging the "surprise" of data under a null hypothesis, though he resisted fixing α\alpha rigidly and treated it more as a continuous strength-of-evidence measure. Neyman and Pearson, working through the late 1920s and 1930s, reframed the problem as a formal decision procedure with two named hypotheses, a pre-fixed rejection region, and two explicitly quantified error rates — the structure of Type I and Type II error used throughout this article. Their framework, requiring the analyst to commit to α\alpha, the direction (one- or two-tailed), and even the sample size before collecting data, is precisely what protects modern laboratory testing from the selective, after-the-fact reasoning that quietly inflates false-positive rates. The synthesis of Fisherian significance testing and Neyman–Pearson decision theory, imperfect and historically contentious as it was, is the hybrid procedure taught and used in essentially every analytical laboratory today.

Origins · 1 minJerzy Neyman and how this was discovered
JN
Jerzy Neyman
1894–1981 · Statistics, University College London and UC Berkeley

Neyman, a Polish-born mathematician, collaborated with Egon Pearson (son of Karl Pearson) to formalize hypothesis testing as a decision problem with explicit, quantifiable error rates rather than a purely evidential "degree of belief." Their 1933 paper "On the Problem of the Most Efficient Tests of Statistical Hypotheses" introduced the alternative hypothesis, the critical region, and the Type I/Type II error distinction in essentially the form used today. Neyman later emigrated to Berkeley, where he built one of the twentieth century's most influential statistics departments and championed confidence intervals as a companion tool to hypothesis tests — the same equivalence proven in the first derivation of this article.

History
- 1908 — William Sealy Gosset ("Student") publishes the tt-distribution, the reference distribution underlying nearly all small-sample tests.
- 1925 — Ronald Fisher publishes Statistical Methods for Research Workers, popularizing significance testing and the 0.05 convention.
- 1928 — Neyman and Pearson begin collaborating on a formal theory of hypothesis testing as a decision procedure.
- 1933 — Neyman and Pearson publish the foundational paper defining Type I/Type II error and the most-powerful-test criterion.
- 1950s–60s — hypothesis testing becomes standard practice in analytical and clinical chemistry, embedded in pharmacopeial and regulatory (EPA, FDA) method validation protocols.
What is the difference between the null hypothesis and the alternative hypothesis?

The null hypothesis H0H_0 is a precise, specific statement — typically "no difference" or "equals this reference value" — chosen because it can be sharply falsified by data. The alternative hypothesis HaH_a is the claim of interest, usually vaguer ("not equal," "greater than"), representing the effect the analyst suspects is real. A test never directly confirms HaH_a; it only assesses whether the observed data would be implausibly rare if H0H_0 were true, and rejects H0H_0 when that implausibility exceeds the chosen threshold α\alpha. This asymmetric structure — attacking the falsifiable claim rather than trying to prove the vague one — is deliberate and mirrors the broader logic of scientific hypothesis testing.

Why is 0.05 the conventional significance level, and is it always the right choice?

The 0.05 threshold traces back to Ronald Fisher's early-twentieth-century agricultural work, where he suggested it as a convenient, roughly-one-in-twenty benchmark for "worth a second look," not as a universal law of nature. Different fields and different decisions warrant different α\alpha: high-stakes regulatory or clinical decisions where false positives are expensive might use α=0.01\alpha=0.01 or smaller (as in Example 2's EPA scenario), while exploratory screening studies might tolerate α=0.10\alpha=0.10 to avoid missing weak but real effects. The right α\alpha balances the real-world cost of a false alarm (Type I) against the cost of a missed detection (Type II), and should ideally be fixed by that cost-benefit reasoning rather than by unreflective convention.

Can a hypothesis test tell me the probability that H₀ is true?

No — this is one of the most persistent misconceptions in applied statistics. The p-value (or the α-based reject/fail-to-reject decision) is a statement about the probability of the data (or data at least this extreme) given that H0H_0 is true, written P(data∣H0)P(\text{data}\mid H_0). It is not P(H0∣data)P(H_0\mid\text{data}), the probability of the hypothesis given the data, which would require Bayesian machinery and a prior probability for H0H_0. Conflating the two is called the "inverse probability fallacy" and leads to serious misinterpretation, such as claiming "there's only a 5% chance the drug doesn't work" from a p<0.05p<0.05 result — a claim the classical test simply cannot support.

How do I decide between a one-tailed and a two-tailed test?

The decision must be made from the scientific or regulatory question before collecting or examining data, never afterward. Use a one-tailed test only when a deviation in one specific direction is the sole outcome of interest and a deviation in the other direction would be treated identically to no deviation at all — for example, an environmental contamination limit where only exceeding the limit triggers action (Example 2). Use a two-tailed test whenever a deviation in either direction would be scientifically or practically meaningful, such as checking whether an instrument reads a certified reference value correctly (Example 1), since both overreading and underreading indicate a problem. Choosing the tail after seeing which direction the data leans is a serious methodological error that silently inflates the true false-positive rate.

What is statistical power, and why does it matter in method development?

Power, 1−β1-\beta, is the probability that a test correctly rejects H0H_0 when a real effect of a specified size truly exists. In method development and validation, power calculations (as in Example 3) let a chemist plan in advance how many replicate measurements are needed to reliably detect a bias or precision difference of practical importance, rather than running an underpowered study that produces an inconclusive "fail to reject H0H_0" result that is falsely read as "no bias exists." Power depends jointly on the true effect size, the measurement precision, the chosen α\alpha, and the sample size — and of these, sample size is usually the only one fully under the analyst's control.

Does a statistically significant result always mean the effect is practically important?

No. Statistical significance only says the observed effect is unlikely to be pure chance at the chosen α\alpha; it says nothing about whether the effect's size matters practically. With a large enough sample size, even a trivially small, practically irrelevant bias will eventually produce tcalct_{calc} large enough to reject H0H_0 (the s→0s\to0 limiting case in the table above illustrates this in the limit of perfect precision). Conversely, a practically important effect can fail to reach significance if the sample size is too small (low power), as nearly happened in Example 2. Good practice always reports the effect size and a confidence interval alongside the significance decision, not the p-value or reject/fail-to-reject verdict alone.

How does hypothesis testing relate to confidence intervals and to specific tests like the t-test or F-test?

A two-tailed hypothesis test at level α\alpha and the corresponding (1−α)(1-\alpha) confidence interval are mathematically equivalent constructions viewed from two angles, as shown explicitly in the derivation above: H0H_0 is rejected exactly when the hypothesized value falls outside the confidence interval. Hypothesis testing is the general logical framework — null/alternative hypotheses, α\alpha, one- vs. two-tailed structure, Type I/II error — that specific procedures instantiate for particular questions: the Comparison of Means by t-test applies it to comparing two sample means, the The F-Test applies it to comparing two variances (precisions), and the Q-Test for Outliers applies it to deciding whether a single suspect data point belongs to the rest of a data set.

Where this leads