Model and hypotheses

In both examples in the first page of this section, there was knowledge of the population standard deviation σ (at least when H0 was true). This greatly simplifies the problem of finding a p-value for the test.

Blood pressure of executives
From published information, the national distribution of blood pressure in males aged 35-44 is known to have a standard deviation σ = 15.
Active ingredient in medicine
The testing procedure is widely used and the errors are known to have a distribution with σ = 0.0068 grams per litre.

In both examples, the hypotheses were of the form,

H0 :   μ  =  μ0
HA :   μ  ≠  μ0

Summary Statistic

The first step in finding a p-value for the test is to identify a summary statistic that throws light on whether H0 or HA is true. When testing the population mean, µ, the obvious summary statistic is the sample mean, , and the hypothesis tests that will be described here are based on this.

We saw earlier that sample mean has a distribution with mean and standard deviation

 =  μ
 = 

Furthermore, the Central Limit Theorem states that the distribution of the sample mean is approximately normal, provided the sample size is not small. (The result holds even for small samples if the population distribution is also normal.)

P-value

The p-value for the test is the probability of getting a sample mean as 'extreme' as the one that was recorded when H0 is true. It can be found directly from the distribution of the sample mean.

Note that we can assume knowledge of both µ and σ in this calculation — the values of both are fixed by H0

Since we know the distribution of the sample mean (when H0 is true), the p-value can be evaluated as the tail area of this distribution.

One-tailed test
If the alternative hypothesis HA specifies large values of µ, the p-value is the upper tail area (shown in green below). If HA is for small values of µ, the opposite tail of the distribution is used.

Two-tailed test
If the alternative hypothesis HA allows for large or small values of µ, the p-value is the sum of the two tail areas below — twice the smaller tail area.