Tutorials › Introduction to Statistics › Test Statistics and Measures of Extremeness

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

Test Statistics and Measures of Extremeness

Learn to calculate and interpret test statistics, distinguish standardized statistics from raw differences, and identify the assumptions that support each calculation.

Intermediate 9 min read

What You'll Learn

  • Define a test statistic and its observed value
  • Explain how a null model supplies a reference distribution
  • Calculate one-sample t and approximate proportion z statistics
  • Distinguish a raw difference from a standardized difference
  • Relate the statistic’s sign and magnitude to the alternative hypothesis
  • Check assumptions before using a test statistic

From a Sample Result to a Test Statistic

A sample result is often expressed as a difference: a sample mean is 4 minutes above a claimed value, or a sample proportion is 0.10 above a hypothesized proportion. By itself, that difference does not tell us how unusual the result is relative to a null model. A difference of 4 minutes may be substantial when measurements vary little, but modest when they vary greatly. Sample size matters too, because averages from larger samples tend to vary less.

A test statistic puts a feature of the observed data on a scale that can be compared with the variation expected under the null hypothesis. The calculation depends on the statistic chosen and the model’s assumptions. In many common tests, it is a difference between an estimate and its null value, divided by a standard error calculated under the null model.

Definition: A test statistic is a function of the sample data chosen to summarize evidence relevant to a statistical hypothesis. Before data are observed, the statistic is a random variable with a distribution under \(H_0\), called its null distribution. After data are observed, its calculated value is the observed test statistic. A standardized statistic expresses a data-based difference in units of its standard error under the null model.

The null distribution is important because “large” or “small” has no universal meaning for a test statistic. The statistic’s observed value must be considered relative to the distribution it would have under \(H_0\). The statistic’s sign also carries direction: a positive value indicates that the estimate is above its null value, while a negative value indicates that it is below. Whether that direction is relevant depends on \(H_a\).

Raw Differences and Standardized Differences

Suppose a sample mean is compared with a hypothesized population mean \(\mu_0\). The raw difference is \(\bar{x}-\mu_0\). It retains the measurement units: if the outcome is measured in minutes, the difference is in minutes. This can be useful for describing the size and direction of the observed discrepancy in context.

A standardized statistic divides that raw difference by its standard error. The result has no measurement units and describes the discrepancy in standard-error units. The standard error represents the typical sampling variation of the estimate under the model. For a one-sample mean test with unknown population standard deviation, the usual statistic is:

$$ t=\frac{\bar{x}-\mu_0}{s/\sqrt{n}} $$

Here \(s/\sqrt{n}\) estimates the standard deviation of the sample mean. The denominator is evaluated using the sample standard deviation, while the null value \(\mu_0\) sets the reference point in the numerator. The resulting statistic is compared with a null distribution, not interpreted as a difference in the original units.

Before using this one-sample \(t\) statistic, assume that the observations are a random, independent sample from a population whose distribution is approximately normal, particularly when the sample is small. Under independent sampling from a normal population, the statistic has a \(t\) distribution with \(df=n-1\) when \(H_0\) is true. The assumptions describe how the data were obtained and the population model; computing a statistic does not make them true.

Worked Example: A One-Sample Mean Statistic

Suppose a hypothetical random sample of 25 independent delivery times has a sample mean of 52 minutes and a sample standard deviation of 10 minutes. The null hypothesis is \(H_0:\mu=48\) minutes, and the alternative is \(H_a:\mu\ne48\) minutes. Assume the delivery-time population is normal.

The sample is stipulated to be random and independent, and the normal-population assumption is stated, so the one-sample \(t\) model is appropriate. The null-based estimate of the standard error is:

$$ SE=\frac{s}{\sqrt{n}}=\frac{10}{\sqrt{25}}=\frac{10}{5}=2\text{ minutes} $$

The raw difference is \(52-48=4\) minutes. Standardizing it gives:

$$ t=\frac{\bar{x}-\mu_0}{s/\sqrt{n}} =\frac{52-48}{10/\sqrt{25}} =\frac{4}{2}=2 $$

The observed statistic is \(t=2\), with \(df=25-1=24\). It is positive because the sample mean is above the null value, and it is 2 estimated standard errors above that value. The raw difference remains 4 minutes. Neither number, by itself, states a probability or establishes a conclusion about \(H_0\); the statistic is interpreted using its null distribution and the specified alternative.

Why the Null Model Determines the Scale

The standard error used in a test statistic must describe sampling variability under the null model. For a mean, if observations are independent with population standard deviation \(\sigma\), then the sample mean has standard deviation \(\sigma/\sqrt{n}\). When testing \(H_0:\mu=\mu_0\), that null model places the mean at \(\mu_0\). If \(\sigma\) is known, the corresponding standardized statistic is:

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

When \(\sigma\) is unknown, it is estimated by \(s\), leading to the \(t\) statistic and its \(t\) reference distribution under the normal-population assumptions. The denominator is therefore not an arbitrary adjustment: it scales the observed difference by the variation expected in repeated samples under the model.

The standardization can be justified directly. Under independent observations from a normal population, the sample mean has distribution \(N(\mu,\sigma^2/n)\). Under \(H_0:\mu=\mu_0\), subtracting \(\mu_0\) centers that distribution at zero, and dividing by its standard deviation gives a standard normal variable:

$$ \bar{X}\sim N\left(\mu_0,\frac{\sigma^2}{n}\right) \quad\Longrightarrow\quad \frac{\bar{X}-\mu_0}{\sigma/\sqrt{n}}\sim N(0,1) $$

This shows why the known-\(\sigma\) statistic is measured in standard-error units under the null. When \(\sigma\) is replaced by \(s\), the extra uncertainty from estimating the population standard deviation is accounted for by the \(t\) distribution rather than the standard normal distribution.

Sample Size and the Meaning of a Difference

A fixed raw difference can correspond to different standardized statistics because the standard error depends on both variability and sample size. This distinction is central to interpreting test statistics: the statistic measures discrepancy relative to expected sampling variation, while the raw difference describes the observed discrepancy in the original units.

Worked Example: The Same Difference With Different Sample Sizes

Consider two hypothetical independent random samples of delivery times from populations assumed normal. In both settings the null hypothesis is \(H_0:\mu=100\) minutes and the alternative is \(H_a:\mu>100\) minutes. Each sample mean is 104 minutes and each sample standard deviation is 10 minutes. The first sample has \(n=25\); the second has \(n=100\).

For the first sample, the raw difference is 4 minutes, and the estimated standard error and statistic are:

$$ SE_1=\frac{10}{\sqrt{25}}=2\text{ minutes}, \qquad t_1=\frac{104-100}{2}=2 $$

For the second sample, the raw difference is still 4 minutes, but the estimated standard error is smaller:

$$ SE_2=\frac{10}{\sqrt{100}}=1\text{ minute}, \qquad t_2=\frac{104-100}{1}=4 $$

Both statistics are positive, in the direction of the one-sided alternative. The second result is 4 estimated standard errors above the null value, compared with 2 for the first. This difference in standardized statistics arises from sample size, not from a larger raw discrepancy. The reference distributions also differ, with \(df=24\) and \(df=99\), so any assessment of extremeness must use the appropriate null distribution for each setting.

Standardizing a Proportion

The same general idea applies to a population proportion. If each observation is an independent Bernoulli outcome with probability \(p\), then under \(H_0:p=p_0\), the null standard error for the sample proportion is \(\sqrt{p_0(1-p_0)/n}\). The resulting standardized statistic is commonly used with a normal approximation when the expected counts under the null are sufficiently large.

For this approximate procedure, the data should come from independent observations with the same probability of success. The normal approximation is more defensible when both \(np_0\) and \(n(1-p_0)\) are sufficiently large; a common guideline is that each is at least 10. The statistic’s calculation does not itself verify random sampling or independence, which must be justified from the study design.

Worked Example: A Proportion Statistic

In a hypothetical quality check, 60 of 100 independently selected items meet a specified standard. Let \(p\) be the population proportion meeting the standard. Test-statistic setup begins with \(H_0:p=0.50\) and \(H_a:p>0.50\). Assume the items are independent and have the same probability of meeting the standard.

The observed sample proportion is \(\hat{p}=60/100=0.60\), a raw difference of \(0.60-0.50=0.10\). Under the null model, the estimated standard error is:

$$ SE_0=\sqrt{\frac{p_0(1-p_0)}{n}} =\sqrt{\frac{0.50(0.50)}{100}} =\sqrt{0.0025}=0.05 $$

The standardized statistic is therefore:

$$ z=\frac{\hat{p}-p_0}{SE_0} =\frac{0.60-0.50}{0.05}=2 $$

The null expected counts are \(np_0=100(0.50)=50\) meeting the standard and \(n(1-p_0)=50\) not meeting it. Both exceed 10, supporting the normal approximation. The observed statistic is \(z=2\): the sample proportion is two null standard errors above 0.50. The observed excess is 0.10, or 10 percentage points. These descriptions retain different information: one is standardized and the other is in proportion units.

What a Statistic Does—and Does Not—Tell Us

A test statistic provides a compact, model-based summary of the sample’s discrepancy from the null value. For a one-sided alternative, its sign indicates whether the result lies in the direction specified by that alternative. For a two-sided alternative, the size of the discrepancy in either direction matters, so the magnitude of a signed statistic can be useful. The precise assessment of which outcomes count as extreme and how that assessment is quantified belongs to the subsequent steps of hypothesis testing.

A standardized statistic is not an effect size in the original measurement units. For example, \(t=2\) does not mean a mean is 2 minutes above the null; it means the observed difference is 2 estimated standard errors. To describe the difference’s practical scale, report the raw difference with its units as well. Conversely, a raw difference alone does not account for sample size or variability.

A statistic also cannot repair a poor design or an unsuitable model. If observations are dependent when independence is assumed, or if a small-sample mean analysis relies on a seriously inappropriate normal model, the reference distribution may not describe the actual sampling behavior. The arithmetic can be correct while the inferential basis is not.

Key takeaway: A raw difference describes how far the observed estimate is from the null value in context and units. A standardized test statistic describes that difference relative to the null model’s standard error. Its interpretation depends on the relevant null distribution, assumptions, and alternative hypothesis.

Common Mistake

A frequent mistake is to compare raw differences alone and call the larger one “more extreme.” That reasoning ignores how variable the measurements are and how many observations were collected. For instance, a 4-minute difference can produce a statistic of 2 or 4 in the two mean examples above. The correction is to report the raw difference for its contextual meaning, then standardize it using the appropriate null-based standard error and interpret the statistic using its null distribution. Do not treat the statistic alone as a probability or a decision.

Check Your Understanding

Use the definitions and examples above to answer these questions.

  1. In a one-sample mean test, what does a test statistic of \(t=-1.5\) say about the sample mean’s direction relative to \(\mu_0\)? What does it not say by itself?
  2. A sample mean is 6 units above its null value. Explain why this raw difference alone is not enough to compare its extremeness with a result from another study.
  3. For a test of \(H_0:\mu=20\), a sample has \(\bar{x}=23\), \(s=6\), and \(n=9\). Calculate the raw difference, estimated standard error, and one-sample \(t\) statistic.
  4. Why does the one-sample mean statistic use the standard error rather than the sample standard deviation alone?
  5. For a proportion test with \(p_0=0.40\) and \(n=50\), calculate the null expected counts for successes and failures. Does each meet the stated guideline for the normal approximation?