Tutorials › Introduction to Statistics › How Sample Size Changes P-Values

The Logic of Tests and P-Values · Tutorial 618 of 996

How Sample Size Changes P-Values

Learn why a fixed, nonzero standardized difference produces stronger test evidence as sample size grows, and why that does not make a small p-value a measure of practical importance.

Intermediate 10 min read

What You'll Learn

  • Relate the two-sided z statistic to sample size and a standardized observed difference.
  • Compare p-values for matched effect sizes at different sample sizes.
  • Explain why small samples may not detect meaningful differences.
  • Identify the zero-effect exception to the sample-size relationship.
  • Distinguish a fixed-effect comparison from what is guaranteed in repeated studies.

Why Sample Size Matters to a P-Value

A p-value reflects how unusual a test statistic would be if the null hypothesis were true. But the statistic depends not only on how far an estimate is from the null value; it also depends on how precisely the estimate is measured. Sample size affects that precision. As a result, two studies can find the same-sized difference but produce different p-values.

This relationship helps explain two results that can seem surprising. A large study can produce a small p-value for a modest difference, while a small study can produce a large p-value even when the difference matters in practice. Neither result, by itself, says whether the difference is important. The examples here isolate the role of sample size using a specified model and matched observed differences.

A Model for Comparing Sample Sizes

Consider a hypothetical study measuring a quantitative outcome. Suppose the observations \(X_1,\ldots,X_n\) are independent and have a normal distribution with population mean \(\mu\) and known population standard deviation \(\sigma\). We test the two-sided hypothesis \(H_0:\mu=\mu_0\) against \(H_a:\mu\ne\mu_0\). This is a useful setting for seeing the sample-size relationship clearly: under the stated model, the sample mean has standard error \(\sigma/\sqrt{n}\).

For this illustration, assume the observations are obtained independently from the population and the normal model and known value of \(\sigma\) are appropriate. Under \(H_0\), the standardized test statistic has the standard normal distribution. Write \(\Phi(z)=P(Z\le z)\) for the cumulative distribution function of a standard normal random variable \(Z\). A two-sided p-value is the null probability of a statistic at least as far from zero as the observed statistic, in either direction.

Definition: In this one-sample z-test, the observed standardized difference is \(d=(\bar{x}-\mu_0)/\sigma\), measured in population standard deviations. The test statistic is \(z=(\bar{x}-\mu_0)/(\sigma/\sqrt{n})\). For a two-sided test, the p-value is \(2[1-\Phi(|z|)]\).

The standardized difference \(d\) describes how far the observed sample mean is from the null value relative to the outcome's standard deviation. It is not the p-value. The standard error, \(\sigma/\sqrt{n}\), describes the typical variability of the sample mean under the model; increasing \(n\) makes this standard error smaller.

Deriving the Sample-Size Relationship

The relationship follows directly by rewriting the test statistic. Substitute \(d=(\bar{x}-\mu_0)/\sigma\) into the expression for \(z\):

$$ z =\frac{\bar{x}-\mu_0}{\sigma/\sqrt{n}} =\frac{\bar{x}-\mu_0}{\sigma}\sqrt{n} =d\sqrt{n}. $$

Therefore, when \(d\) is held fixed and nonzero, \(|z|=|d|\sqrt{n}\) increases strictly as \(n\) increases. The two-sided p-value decreases strictly too, because \(2[1-\Phi(|z|)]\) decreases as the nonnegative value \(|z|\) increases. There is an important exception: if \(d=0\), then \(z=0\) for every sample size, and the two-sided p-value is \(2[1-\Phi(0)]=1\). In that case, increasing \(n\) does not change the p-value.

Worked Example: Same Difference, Different Sample Sizes

Suppose two hypothetical studies compare a mean outcome with a null value of \(\mu_0=50\) units. In each study the observed sample mean is 52 units, and the known population standard deviation is \(\sigma=10\) units. The first study has \(n=25\); the second has \(n=100\). Assume in each case that the independent normal model with known \(\sigma\) applies.

In both studies, the observed difference is \(52-50=2\) units, so the standardized difference is \(d=2/10=0.2000\). For the first study, the standard error is \(10/\sqrt{25}=2\) units, giving

$$ z=\frac{52-50}{10/\sqrt{25}}=\frac{2}{2}=1.000. $$

Its two-sided p-value is \(2[1-\Phi(1.000)]\approx 0.3173\). For the second study, the standard error is \(10/\sqrt{100}=1\) unit, so

$$ z=\frac{52-50}{10/\sqrt{100}}=\frac{2}{1}=2.000. $$

Its two-sided p-value is \(2[1-\Phi(2.000)]\approx 0.04550\). The observed difference is 2 units in both studies, but the larger study's estimate is more precise under the model. Its test statistic is farther from zero in standard-error units, and its p-value is smaller. This comparison concerns statistical evidence under the null model; it does not make a 2-unit difference more or less important in the outcome's context.

Small Samples Can Miss Meaningful Differences

A large p-value can arise because the observed difference is small, because the data are variable, because the sample is small, or through a combination of these factors. In particular, a small sample can have a large standard error. Then even a difference that would matter in practice may not look especially unusual relative to the null distribution. A large p-value is not proof that the null value is correct.

Worked Example: A Meaningful Difference with Limited Precision

Imagine a hypothetical clinical measurement for which specialists regard a 2-unit change as meaningful. The null mean is \(\mu_0=100\) units, the known population standard deviation is \(\sigma=10\) units, and a small study of \(n=25\) independent observations has a sample mean of 102 units. Assume the normal model and known standard deviation are appropriate.

The observed difference is 2 units, or \(d=(102-100)/10=0.2000\) standard deviations. Its standard error is \(10/\sqrt{25}=2\) units. Thus,

$$ z=\frac{102-100}{10/\sqrt{25}}=\frac{2}{2}=1.000, \qquad p=2[1-\Phi(1.000)]\approx 0.3173. $$

The data do not provide strong evidence against \(H_0\) in this two-sided test: the p-value is about 0.3173. Yet the observed 2-unit difference is the same size as the change the specialists regard as meaningful. The p-value alone cannot establish that the effect is unimportant, nor can this result establish that the null value is true. It says that, under the specified null model, a test statistic at least this far from zero is not unusual.

To see the role of sample size while keeping the observed difference fixed, consider a hypothetical study with the same outcome model, \(\bar{x}=102\), and \(\sigma=10\), but \(n=400\). The standard error is \(10/\sqrt{400}=0.5\) units, giving

$$ z=\frac{102-100}{0.5}=4.000, \qquad p=2[1-\Phi(4.000)]\approx 0.00006334. $$

The small p-value in this matched comparison arises because the same 2-unit difference is estimated with greater precision at the larger sample size. It is still the size and context of the difference—not the p-value alone—that determine its practical importance.

What the Fixed-Effect Comparison Does—and Does Not—Say

The formula \(z=d\sqrt{n}\) describes what happens when the observed standardized difference is held fixed. It does not say that adding observations to any real study must make its p-value smaller at every step. In an actual study, the sample mean can change as new observations arrive, so \(d\) can change too. For example, new observations may bring the sample mean closer to the null value or farther from it.

The relationship is still useful for understanding why sample size matters. If a nonzero difference remains about the same in standard-deviation units as a study grows, the statistic will typically grow in magnitude. But random variation means that the observed difference is not guaranteed to stay fixed. The p-value is calculated from the data actually collected, not from a promise that a future estimate will match the current one.

Worked Example: The Zero-Difference Exception

Suppose two hypothetical studies use the same null value, \(\mu_0=50\) units, and known standard deviation, \(\sigma=10\) units. In each study, the observed sample mean is exactly 50 units. The first has \(n=25\), and the second has \(n=100\). Assume the model conditions stated earlier hold.

For \(n=25\), the standard error is \(10/\sqrt{25}=2\), and \(z=(50-50)/2=0\). For \(n=100\), the standard error is \(10/\sqrt{100}=1\), and \(z=(50-50)/1=0\). In both studies,

$$ d=\frac{50-50}{10}=0, \qquad p=2[1-\Phi(|0|)]=1. $$

The sample size quadruples, but the test statistic and p-value do not change. This is why the claim that larger \(n\) always makes a p-value smaller is incorrect: with a fixed nonzero \(d\), the p-value decreases; with \(d=0\), it remains 1.

Why the Distinction Matters

Sample size is one reason statistical significance and practical importance can diverge. A very large study may detect a difference that is precisely estimated but too small to matter in context. A small study may yield a large p-value even though its observed difference would matter if it were real. Interpreting a result therefore requires considering the estimated difference and its units alongside the p-value, rather than treating a threshold as a measure of importance.

These comparisons also show why p-values from different studies are not direct measures of effect size. A p-value combines the observed difference, its uncertainty, and the way the test counts extreme outcomes. When the test and model are the same, increasing \(n\) can change the p-value even if the observed difference is unchanged. The p-value answers a question about compatibility with a null model; it does not by itself report how large the difference is.

Common Mistakes

  • “A larger sample always gives a smaller p-value.” Not necessarily. In the fixed-\(d\) comparison, the p-value decreases with \(n\) only when \(d\ne0\); at \(d=0\), it remains 1. In real studies, the observed \(d\) can also change as data are added.
  • “A large p-value proves the effect is zero.” A large p-value indicates that the observed test statistic is not unusually extreme under the null model. It does not prove that the null is true or rule out a meaningful difference.
  • “A small p-value means the effect is important.” A p-value is not a measure of practical importance. Interpret the estimated difference in its original units and context as well.
  • Comparing p-values without comparing differences. Studies with different sample sizes can have different p-values for the same-sized difference. Report and interpret the estimated difference, not just whether a p-value crosses a threshold.
Key takeaway: In the two-sided z-test shown here, \(z=d\sqrt{n}\). Holding a nonzero standardized observed difference fixed, a larger sample makes \(|z|\) larger and the p-value smaller. If the difference is exactly zero, the p-value remains 1. In real studies the observed difference can vary, and a p-value does not tell you whether an effect matters in practice.

Check Your Understanding

Use the model and distinctions developed above to answer these questions.

  1. With a fixed nonzero \(d\), what happens to \(|z|\) when \(n\) increases, and why does the two-sided p-value change in the opposite direction?
  2. If \(d=0\), what are \(z\) and the two-sided p-value for any positive sample size?
  3. A small study has a large p-value, but its observed difference is meaningful in context. What can and cannot be concluded from that p-value?
  4. Why is the statement “adding observations always decreases the p-value” too strong for an actual study?
  5. Two studies report the same estimated difference but have different sample sizes. Name one reason their p-values may differ, and one piece of context needed to judge practical importance.