P-value for a one-tailed test
Consider a test of the hypotheses
H0 : π = π0
HA : π < π0
where π0 is a constant of interest. The following diagram shows how the p-value is found:
Since the probabilities in one tail of the distribution are added, this is called a one-tailed test.
P-value for a two-tailed test
If the alternative hypothesis allows either high or low values of x, the test is called a two-tailed test,
H0 : π = π0
HA : π ≠ π0
The p-value is then double the smaller tail probability since values of x in both tails of the binomial distribution would provide evidence for HA.
Example
In a population of people, a proportion 0.574 have blood group O. In a sub-group of this population, a sample of 54 individuals were tested and 26 of these had blood group O. Is there any evidence that they differ from the main population?
This question can be expressed with the hypotheses
H0 : π = 0.574
HA : π ≠ 0.574
If the sub-group had the same proportion with blood group O as the main population, the number out of 54 with this blood group would have the binomial distribution below.
There is a probability 0.1085 of getting 26 or fewer, but large sample numbers with blood group O would also throw doubt on the null hypothesis, so the p-value is double the low-tail probability, 0.2169.
From the large p-value, we conclude that there is no evidence of a difference between the sub-group and the main population.