01 / 21
p

Test Statistics
& p-Values

Learn how to quantify evidence against a null hypothesis using test statistics and interpret the probability of observing your data.

College Statistics

What Is Hypothesis Testing?

Hypothesis testing is a formal procedure to decide whether sample data provide enough evidence to reject a claim about a population parameter. Every test follows the same core logic:

1. State Hypotheses
Define \( H_0 \) (null) and \( H_a \) (alternative) about the parameter.
2. Collect Data
Gather a random sample and compute a summary statistic.
3. Make a Decision
Use the test statistic and p-value to reject or fail to reject \( H_0 \).

What Is a Test Statistic?

A test statistic measures how far your sample result is from the null hypothesis value, in standardized units. The larger the absolute value, the stronger the evidence against \( H_0 \).

Think of it as a signal-to-noise ratio: the numerator is the signal (how much the data differ from \( H_0 \)) and the denominator is the noise (how much variability we expect).

What Is a p-Value?

The p-value is the probability of obtaining a test statistic at least as extreme as the one observed, assuming \( H_0 \) is true.

0 +t −t p/2 p/2 Test Statistic

The \(z\)-Test Statistic

When the population standard deviation \( \sigma \) is known (or \( n \) is large), we use the \( z \)-test for a population mean:

\( \bar{x} \)
Sample mean: the average of your observed data
\( \mu_0 \)
Null hypothesis value: the claimed population mean
\( \sigma / \sqrt{n} \)
Standard error: measures sampling variability

The \(t\)-Test Statistic

When \( \sigma \) is unknown (the usual case), we estimate it with the sample standard deviation \( s \) and use the \( t \)-test:

The \( t \)-distribution has heavier tails than the standard normal, especially for small \( n \). As \( n \to \infty \), the \( t \)-distribution approaches the \( z \)-distribution.

\(z\) vs \(t\): When to Use Each

\( z \)-Test \( t \)-Test
\( \sigma \) known? Yes No (use \( s \))
Distribution Standard Normal \( t \) with \( df = n-1 \)
Sample size Large \( n \geq 30 \) Any \( n \)
Tails Thinner Heavier (wider)
In practice Rare Most common

One-Tailed vs Two-Tailed Tests

Two-Tailed
\( H_a\!: \mu \neq \mu_0 \)
p-value = area in both tails. Tests for any difference from \( \mu_0 \).
Left-Tailed
\( H_a\!: \mu < \mu_0 \)
p-value = area in the left tail. Tests if the mean is less than \( \mu_0 \).
Right-Tailed
\( H_a\!: \mu > \mu_0 \)
p-value = area in the right tail. Tests if the mean is greater than \( \mu_0 \).

How to Perform a Hypothesis Test

1
State hypotheses: Write \( H_0 \) and \( H_a \) using the population parameter.
2
Choose significance level: Set \( \alpha \) (commonly \( 0.05 \)).
3
Check conditions: Random sample, independence, normality (or large \( n \)).
4
Compute the test statistic: Use the \( z \) or \( t \) formula.
5
Find the p-value: Use a table or calculator based on the test statistic.
6
Make a decision: If \( p \leq \alpha \), reject \( H_0 \). Otherwise, fail to reject.

Significance Level \( \alpha \)

The significance level \( \alpha \) is the threshold for deciding when to reject \( H_0 \). It represents the maximum probability of a Type I error (rejecting a true \( H_0 \)) that we're willing to accept.

\( \alpha = 0.05 \)
Most common choice. A 5% chance of a false positive. Standard in most research.
\( \alpha = 0.01 \)
Stricter threshold. Used when consequences of a false positive are severe.

Example 1: \( z \)-Test

A factory claims its light bulbs last \( \mu = 1000 \) hours. A sample of \( n = 36 \) bulbs has \( \bar{x} = 985 \) hours. The population \( \sigma = 60 \) hours. Test at \( \alpha = 0.05 \) (two-tailed).

Example 2: \( t \)-Test

A teacher believes students sleep less than 8 hours. A sample of \( n = 20 \) students has \( \bar{x} = 7.4 \) hours and \( s = 1.2 \) hours. Test at \( \alpha = 0.05 \) (left-tailed).

Visualizing the \( t \)-Test Result

0 -2.24 p = 0.019 t-distribution (df = 19) Reject H₀ Fail to reject

Example 3: Proportion Test

A company claims 80% of customers are satisfied. In a survey of \( n = 200 \), only \( \hat{p} = 0.74 \) are satisfied. Test at \( \alpha = 0.05 \) (left-tailed).

Common Mistakes

✕ Confusing p-value meaning
The p-value is not the probability that \( H_0 \) is true. It is the probability of observing data at least as extreme as the sample, assuming \( H_0 \) is true.
✕ Saying "accept \( H_0 \)"
We never "accept" \( H_0 \). We either reject it or fail to reject it. Absence of evidence is not evidence of absence.
✕ Wrong tail direction
Using a two-tailed test when \( H_a \) is one-sided (or vice versa) gives the wrong p-value.
✕ Ignoring conditions
Skipping checks for randomness, independence, or normality can invalidate the entire test.

Test Statistic Summary

Mean (\( z \)) Mean (\( t \)) Proportion
Parameter \( \mu \) \( \mu \) \( p \)
Formula \( \frac{\bar{x}-\mu_0}{\sigma/\sqrt{n}} \) \( \frac{\bar{x}-\mu_0}{s/\sqrt{n}} \) \( \frac{\hat{p}-p_0}{\sqrt{\frac{p_0 q_0}{n}}} \)
Distribution Normal \( t_{n-1} \) Normal
When to use \( \sigma \) known \( \sigma \) unknown Categorical data

Question 1 of 5

A researcher computes a test statistic of \( z = 2.45 \) for a two-tailed test. Using a standard normal table, \( P(Z > 2.45) \approx 0.0071 \). What is the p-value?

Question 2 of 5

A sample of \( n = 25 \) has \( \bar{x} = 52 \), \( s = 10 \), and we test \( H_0\!: \mu = 50 \). What is the test statistic?

Question 3 of 5

If the p-value of a test is 0.03 and the significance level is \( \alpha = 0.05 \), what is the correct conclusion?

Question 4 of 5

Which statement correctly describes the p-value?

Question 5 of 5

A company tests \( H_0\!: p = 0.50 \) vs \( H_a\!: p > 0.50 \) using \( n = 100 \) and finds \( \hat{p} = 0.58 \). What type of test is this, and which test statistic formula applies?