How to Determine a pValue When Testing a Null Hypothesis
When you test a hypothesis about a population, you can use your test statistic to decide whether to reject the null hypothesis, H_{0}. You make this decision by coming up with a number, called a pvalue.
A pvalue is a probability associated with your critical value. The critical value depends on the probability you are allowing for a Type I error. It measures the chance of getting results at least as strong as yours if the claim (H_{0}) were true.
The following figure shows the locations of a test statistic and their corresponding conclusions.
Note that if the alternative hypothesis is the lessthan alternative, you reject H_{0} only if the test statistic falls in the left tail of the distribution (below –2). Similarly, if H_{a} is the greaterthan alternative, you reject H_{0} only if the test statistic falls in the right tail (above 2).
To find the pvalue for your test statistic:

Look up your test statistic on the appropriate distribution — in this case, on the standard normal (Z) distribution (see the following Ztable).

Find the probability that Z is beyond (more extreme than) your test statistic:

If H_{a} contains a lessthan alternative, find the probability that Z is less than your test statistic (that is, look up your test statistic on the Ztable and find its corresponding probability). This is the pvalue. (Note: In this case, your test statistic is usually negative.)

If H_{a} contains a greaterthan alternative, find the probability that Z is greater than your test statistic (look up your test statistic on the Ztable, find its corresponding probability, and subtract it from one). The result is your pvalue. (Note: In this case, your test statistic is usually positive.)

If H_{a} contains a notequalto alternative, find the probability that Z is beyond your test statistic and double it. There are two cases:
If your test statistic is negative, first find the probability that Z is less than your test statistic (look up your test statistic on the Ztable and find its corresponding probability). Then double this probability to get the pvalue.
If your test statistic is positive, first find the probability that Z is greater than your test statistic (look up your test statistic on the Ztable, find its corresponding probability, and subtract it from one). Then double this result to get the pvalue.

Suppose you are testing a claim that the percentage of all women with varicose veins is 25%, and your sample of 100 women had 20% with varicose veins. Then the sample proportion p=0.20. The standard error for your sample percentage is the square root of p(1p)/n which equals 0.04 or 4%. You find the test statistic by taking the proportion in the sample with varicose veins, 0.20, subtracting the claimed proportion of all women with varicose veins, 0.25, and then dividing the result by the standard error, 0.04. These calculations give you a test statistic (standard score) of –0.05 divided by 0.04 = –1.25. This tells you that your sample results and the population claim in H_{0} are 1.25 standard errors apart; in particular, your sample results are 1.25 standard errors below the claim.
When testing H_{0}: p = 0.25 versus H_{a}: p < 0.25, you find that the pvalue of 1.25 by finding the probability that Z is less than 1.25. When you look this number up on the above Ztable, you find a probability of 0.1056 of Z being less than this value.
Note: If you had been testing the twosided alternative,
the pvalue would be 2 ∗ 0.1056, or 0.2112.
If the results are likely to have occurred under the claim, then you fail to reject H_{0} (like a jury decides not guilty). If the results are unlikely to have occurred under the claim, then you reject H_{0} (like a jury decides guilty).