||This article may be too technical for most readers to understand. (February 2013)|
In statistical significance testing the p-value is the probability of obtaining a test statistic at least as extreme as the one that was actually observed, assuming that the null hypothesis is true. One often "rejects the null hypothesis" when the p-value is less than the predetermined significance level which is often 0.05 or 0.01, indicating that the observed result would be highly unlikely under the null hypothesis. Many common statistical tests, such as chi-squared tests or Student's t-test, produce test statistics which can be interpreted using p-values.
The p-value is a key concept in the approach of Ronald Fisher, where he uses it to measure the weight of the data against a specified hypothesis, and as a guideline to ignore data that does not reach a specified significance level. Fisher's approach does not involve any alternative hypothesis, which is instead the Neyman–Pearson approach. The p-value should not be confused with the Type I error rate (false positive rate) α in the Neyman–Pearson approach – though α is also called a "significance level" and is often 0.05, these terms have different meanings, these are incompatible approaches, and the numbers p and α cannot meaningfully be compared. There is a great deal of confusion and misunderstanding on this point, and many misinterpretations, discussed below. Fundamentally, the p-value does not in itself allow reasoning about the probabilities of hypotheses (this requires a prior, as in Bayesian statistics), nor choosing between different hypotheses (this is instead done in Neyman–Pearson statistical hypothesis testing) – it is simply a measure of how likely the data is to have occurred by chance, assuming the null hypothesis is true.
Despite the above caveats, statistical hypothesis tests making use of p-values are commonly used in many fields of science and social sciences, such as economics, psychology, biology, criminal justice and criminology, and sociology, though this is criticized (see below).
Computing a p-value requires a null hypothesis, a test statistic (together with deciding if one is doing one-tailed test or a two-tailed test), and data. A few simple examples follow, each illustrating a potential pitfall.
- One roll of a pair of dice
Rolling a pair of dice once, assuming a null hypothesis of fair dice, the test statistic of "total value of numbers rolled" (one-tailed), and with data of both dice showing 6 (so a test statistic of 12, the total) yields a p-value of 1/36, or about 0.028 (most extreme value out of 6×6 = 36 possible outcomes). At the 0.05 significance level, one rejects the hypothesis that the dice are fair (not loaded towards 6).
This illustrates the danger with blindly applying p-value without considering experiment design – a single roll of a pair of dice is a very weak basis (insufficient data) to draw any meaningful conclusion.
- Five heads in a row
Flipping a coin five times, assuming a null hypothesis of a fair coin, a test statistic of "total number of heads" (one-tailed or two-tailed), and with data of all heads (HHHHH) yields a test statistic of 5. In a one-tailed test, this is the unique most extreme value (out of 32 possible outcomes), and yields a p-value of 1/25 = 1/32 ≈ 0.03, which is significant at the 0.05 level. In a two-tailed test, all tails (TTTTT) is as extreme, and thus the data of HHHHH yields a p-value of 2/25 = 1/16 ≈ 0.06, which is not significant at the 0.05 level. These correspond respectively to testing if the coin is biased towards heads, or if the coin is biased either way.
This demonstrates that specifying a direction (on a symmetric test statistic) halves the p-value (increases the significance) and can mean the difference between data being considered significant or not.
- Sample size dependence
Flipping a coin n times, assuming a null hypothesis of a fair coin, a test statistic of "total number of heads" (two-tailed), and with data of all heads yields a test statistic of n and a p-value of 2/2n = 2−(n−1). If one has a two-headed coin and flips the coin 5 times (obtaining heads each time, as it is two-headed), the p-value is 0.0625 > 0.05, but if one flips the coin 10 times (obtaining heads each time), the p-value is ≈ 0.002 < 0.05.
In both cases the data suggest that the null hypothesis is false, but changing the sample size changes the p-value and significance level. In the first case the sample size is not large enough to allow the null hypothesis to be rejected at the 0.05 level (in fact, in this example the p-value cannot be below 0.05 given a sample size of 5). In cases when a large sample size produces a significant result, a smaller sample size may produce a result that is not significant, simply because the sample size is too small to detect the effect.
This demonstrates that in interpreting p-values, one must also know the sample size, which complicates the analysis.
- Alternating coin flips
Flipping a coin ten times, assuming a null hypothesis of a fair coin, a test statistic of "total number of heads" (two-tailed), and with data of alternating heads/tails (HTHTHTHTHT) yields a test statistic of 5 and a p-value of 1 (completely unexceptional), as this is exactly the expected number of heads.
However, using the subtler test statistic of "number of alternations" (times when H is followed by T or T is followed by H), again two-tailed, yields a test statistic of 9, which is extreme, and has a p-value of which is extremely significant. The expected number of alternations is 4.5 (there are 9 gaps, and each has a 0.5 chance of being an alternation), the values as extreme as this are 0 and 9, and there are only 4 sequences (out of 1024 possible outcomes) this extreme: all heads, all tails, alternating starting from heads (this case), or alternating starting from tails.
This data indicates that, in terms of this test statistic, the data set is extremely unlikely to have occurred by chance, though it does not suggest that the coin is biased towards heads or tails. There is no "alternative hypothesis", only rejection of the null hypothesis, and such data could have many causes – the data may instead be forged, or the coin flipped by a magician who intentionally alternated outcomes.
This example demonstrates that the p-value depends completely on the test statistic used, and illustrates that p-values are about rejecting a null hypothesis, not about considering other hypotheses.
- Impossible outcome and very unlikely outcome
Flipping a coin two times, assuming a null hypothesis of a two-headed coin, a test statistic of "total number of heads" (one-tailed), and with data of one head and one tail (HT) yields a test statistic of 1, and a p-value of 0. In this case the data is inconsistent with the hypothesis – for a two-headed coin, a tail can never come up. In this case the outcome is not simply unlikely in the null hypothesis, but in fact impossible, and the null hypothesis can be definitely rejected as false. In practice such experiments almost never occur, as all data that could be observed would be possible in the null hypothesis, albeit unlikely.
If the null hypothesis were instead that the coin came up heads 99% of the time (otherwise the same setup), the p-value would instead be[a] In this case the null hypothesis could not definitely be ruled out – this outcome is unlikely in the null hypothesis, but not impossible – but the null hypothesis would be rejected at the 0.05 level, and in fact at the 0.02 level, since the outcome is less than 2% likely in the null hypothesis.
Coin flipping 
As an example of a statistical test, an experiment is performed to determine whether a coin flip is fair (equal chance of landing heads or tails) or unfairly biased (one outcome being more likely than the other).
Suppose that the experimental results show the coin turning up heads 14 times out of 20 total flips. The null hypothesis is that the coin is fair, so the p-value of this result is the chance of a fair coin landing on heads at least 14 times out of 20 flips. This probability can be computed from binomial coefficients as
This probability is the p-value, considering only extreme results which favor heads. This is called a one-tailed test. However, the deviation can be in either direction, favoring either heads or tails. We may instead calculate the two-tailed p-value, which considers deviations favoring either heads or tails. As the binomial distribution is symmetrical for a fair coin, the two-sided p-value is simply twice the above calculated single-sided p-value; i.e., the two-sided p-value is 0.115.
In the above example we thus have:
- Null hypothesis (H0): The coin is fair; Prob(heads) = 0.5
- Observation O: 14 heads out of 20 flips; and
- p-value of observation O given H0 = Prob(≥ 14 heads or ≥ 14 tails) = 2*(1-Prob(< 14)) = 0.115.
The calculated p-value exceeds 0.05, so the observation is consistent with the null hypothesis, as it falls within the range of what would happen 95% of the time were the coin in fact fair. Hence, we fail to reject the null hypothesis at the 5% level. Although the coin did not fall evenly, the deviation from expected outcome is small enough to be consistent with chance.
However, had one more head been obtained, the resulting p-value (two-tailed) would have been 0.0414 (4.14%). This time the null hypothesis – that the observed result of 15 heads out of 20 flips can be ascribed to chance alone – is rejected when using a 5% cut-off.
In brief, the (left-tailed) p-value is the quantile of the value of the test statistic, with respect to the sampling distribution under the null hypothesis. The right-tailed p-value is one minus the quantile, while the two-tailed p-value is twice whichever of these is smaller. This is elaborated below.
Computing a p-value requires a null hypothesis, a test statistic (together with deciding if one is doing one-tailed test or a two-tailed test), and data. The key preparatory computation is computing the cumulative distribution function (CDF) of the sampling distribution of the test statistic under the null hypothesis; this may depend on parameters in the null distribution and the number of samples in the data. The test statistic is then computed for the actual data, and then its quantile computed by inputting it into the CDF. This is then normalized as follows:
- one-tailed (left tail): quantile, value of cumulative distribution function (since values close to 0 are extreme);
- one-tailed (right tail): one minus quantile, value of complementary cumulative distribution function (since values close to 1 are extreme: 0.95 becomes 0.05);
- two-tailed: twice p-value of one-tailed, for whichever side value is on (since values close to 0 or 1 are both extreme: 0.05 and 0.95 both have a p-value of 0.10, as one adds the tails on both sides).
Even though computing the test statistic on given data may be easy, computing the sampling distribution under the null hypothesis, and then computing its CDF is often a difficult computation. Today this computation is done using statistical software, often via numeric methods (rather than exact formulas), while in the early and mid 20th century, this was instead done via tables of values, and one interpolated or extrapolated p-values from these discrete values. Rather than using a table of p-values, Fisher instead inverted the CDF, publishing a list of values of the test statistic for given fixed p-values; this corresponds to computing the quantile function (inverse CDF).
Hypothesis tests, such as Student's t-test, typically produce test statistics whose sampling distributions under the null hypothesis are known. For instance, in the above coin-flipping example, the test statistic is the number of heads produced; this number follows a known binomial distribution if the coin is fair, and so the probability of any particular combination of heads and tails can be computed. To compute a p-value from the test statistic, one must simply sum (or integrate over) the probabilities of more extreme events occurring. For commonly used statistical tests, test statistics and their corresponding p-values are often tabulated in textbooks and reference works.
Traditionally, following Fisher, one rejects the null hypothesis if the p-value is less than or equal to a specified significance level, often 0.05, or more stringent values, such as 0.02 or 0.01. These numbers should not be confused with the Type I error rate α in Neyman–Pearson-style statistical hypothesis testing; see misunderstandings, below. A significance level of 0.05 would deem extraordinary any result that is within the most extreme 5% of all possible results under the null hypothesis. In this case a p-value less than 0.05 would result in the rejection of the null hypothesis at the 5% (significance) level.
In the 1770s Laplace considered the statistics of almost half a million births. The statistics showed an excess of boys compared to girls. He concluded by calculation of a p-value that the excess was a real, but unexplained, effect.
The p-value was first formally introduced by Karl Pearson in his Pearson's chi-squared test, using the chi-squared distribution and notated as capital P. The p-values for the chi-squared distribution (for various values of χ2 and degrees of freedom), now notated as P, was calculated in (Elderton 1902), collected in (Pearson 1914, pp. xxxi–xxxiii, 26–28, Table XII) The use of the p-value in statistics was popularized by Ronald Fisher, and it plays a central role in Fisher's approach to statistics.
In the influential book Statistical Methods for Research Workers (1925), Fisher proposes the level p = 0.05, or a 1 in 20 chance of being exceeded by chance, as a limit for statistical significance, and applies this to a normal distribution (as a two-tailed test), thus yielding the rule of two standard deviations (on a normal distribution) for statistical significance – see 68–95–99.7 rule.[b]
He then computes a table of values, similar to Elderton, but, importantly, reverses the roles of χ2 and p. That is, rather than computing p for different values of χ2 (and degrees of freedom n), he computes values of χ2 that yield specified p-values, specifically 0.99, 0.98, 0.95, 0,90, 0.80, 0.70, 0.50, 0.30, 0.20, 0.10, 0.05, 0.02, and 0.01. This allowed computed values of χ2 to be compared against cutoffs, and encouraged the use of p-values (especially 0.05, 0.02, and 0.01) as cutoffs, instead of computing and reporting p-values themselves. The same type of tables were then compiled in (Fisher & Yates 1938), which cemented the approach.
As an illustration of the application of p-values to the design and interpretation of experiments, in his following book The Design of Experiments (1935), Fisher presented the lady tasting tea experiment, which is the archetypal example of the p-value.
To evaluate a lady's claim that she (Muriel Bristol) could distinguish by taste how tea is prepared (first adding the milk to the cup, then the tea, or first tea, then milk), she was sequentially presented with 8 cups: 4 prepared one way, 4 prepared the other, and asked to determine the preparation of each cup (knowing that there were 4 of each). In this case the null hypothesis was that she had no special ability, the test was Fisher's exact test, and the p-value was so Fisher was willing to reject the null hypothesis (consider the outcome highly unlikely to be due to chance) if all were classified correctly. (In the actual experiment, Bristol correctly classified all 8 cups.)
Fisher reiterated the p = 0.05 threshold and explained its rationale, stating:
It is usual and convenient for experimenters to take 5 per cent. as a standard level of significance, in the sense that they are prepared to ignore all results which fail to reach this standard, and, by this means, to eliminate from further discussion the greater part of the fluctuations which chance causes have introduced into their experimental results.
He also applies this threshold to the design of experiments, noting that had only 6 cups been presented (3 of each), a perfect classification would have only yielded a p-value of which would not have met this level of significance. Fisher also underlined the frequentist interpretation of p, as the long-run proportion of values at least as extreme as the data, assuming the null hypothesis is true.
In later editions, Fisher explicitly contrasted the use of the p-value for statistical inference in science with the Neyman–Pearson method, which he terms "Acceptance Procedures". Fisher emphasizes that while fixed levels such as 5%, 2%, and 1% are convenient, the exact p-value can be used, and the strength of evidence can and will be revised with further experimentation. In contrast, decision procedures require a clear-cut decision, yielding an irreversible action, and the procedure is based on costs of error, which he argues are inapplicable to scientific research.
Despite the ubiquity of p-value tests, this particular test for statistical significance has been criticized for its inherent shortcomings and the potential for misinterpretation.
The data obtained by comparing the p-value to a significance level will yield one of two results: either the null hypothesis is rejected, or the null hypothesis cannot be rejected at that significance level (which however does not imply that the null hypothesis is true). In Fisher's formulation, there is a disjunction: a low p-value means either that the null hypothesis is true and a highly improbable event has occurred, or that the null hypothesis is false.
However, people interpret the p-value in many incorrect ways, and try to draw other conclusions from p-values, which do not follow.
The p-value does not in itself allow reasoning about the probabilities of hypotheses; this requires multiple hypotheses or a range of hypotheses, with a prior distribution of likelihoods between them, as in Bayesian statistics, in which case one uses a likelihood function for all possible values of the prior, instead of the p-value for a single null hypothesis.
The p-value refers only to a single hypothesis, called the null hypothesis, and does not make reference to or allow conclusions about any other hypotheses, such as the alternative hypothesis in Neyman–Pearson statistical hypothesis testing. In that approach one instead has a decision function between two alternatives, often based on a test statistic, and one computes the rate of Type I and type II errors as α and β. However, the p-value of a test statistic cannot be directly compared to these error rates α and β – instead it is fed into a decision function.
- The p-value is not the probability that the null hypothesis is true, nor is it the probability that the alternative hypothesis is false – it is not connected to either of these.
In fact, frequentist statistics does not, and cannot, attach probabilities to hypotheses. Comparison of Bayesian and classical approaches shows that a p-value can be very close to zero while the posterior probability of the null is very close to unity (if there is no alternative hypothesis with a large enough a priori probability and which would explain the results more easily). This is Lindley's paradox. But there are also a priori probability distributions where the posterior probability and the p-value have similar or equal values.
- The p-value is not the probability that a finding is "merely a fluke."
As the calculation of a p-value is based on the assumption that a finding is the product of chance alone, it patently cannot also be used to gauge the probability of that assumption being true. This is different from the real meaning which is that the p-value is the chance of obtaining such results if the null hypothesis is true.
- The p-value is not the probability of falsely rejecting the null hypothesis. This error is a version of the so-called prosecutor's fallacy.
- The p-value is not the probability that a replicating experiment would not yield the same conclusion. Quantifying the replicability of an experiment was attempted through the concept of p-rep (which is heavily criticized)
- The significance level, such as 0.05, is not determined by the p-value.
Rather, the significance level is decided before the data are viewed, and is compared against the p-value, which is calculated after the test has been performed. (However, reporting a p-value is more useful than simply saying that the results were or were not significant at a given level, and allows readers to decide for themselves whether to consider the results significant.)
- The p-value does not indicate the size or importance of the observed effect (compare with effect size). The two do vary together however – the larger the effect, the smaller sample size will be required to get a significant p-value.
Critics of p-values point out that the criterion used to decide "statistical significance" is based on an arbitrary choice of level (often set at 0.05). If significance testing is applied to hypotheses that are known to be false in advance, a non-significant result will simply reflect an insufficient sample size; a p-value depends only on the information obtained from a given experiment.
The p-value is incompatible with the likelihood principle, and p-value depends on the experiment design, or equivalently on the test statistic in question. That is, the definition of "more extreme" data depends on the sampling methodology adopted by the investigator; for example, the situation in which the investigator flips the coin 100 times yielding 50 heads has a set of extreme data that is different from the situation in which the investigator continues to flip the coin until 50 heads are achieved yielding 100 flips. This is to be expected, as the experiments are different experiments, and the sample spaces and the probability distributions for the outcomes are different even though the observed data (50 heads out of 100 flips) are the same for the two experiments.
Some regard the p-value as the main result of statistical significance testing, rather than the acceptance or rejection of the null hypothesis at a pre-prescribed significance level. Fisher proposed p as an informal measure of evidence against the null hypothesis. He called on researchers to combine p in the mind with other types of evidence for and against that hypothesis, such as the a priori plausibility of the hypothesis and the relative strengths of results from previous studies.
Many misunderstandings concerning p arise because statistics classes and instructional materials ignore or at least do not emphasize the role of prior evidence in interpreting p. A renewed emphasis on prior evidence could encourage researchers to place p in the proper context, evaluating a hypothesis by weighing p together with all the other evidence about the hypothesis.
Related quantities 
A closely related concept is the E-value, which is the average number of times in multiple testing that one expects to obtain a test statistic at least as extreme as the one that was actually observed, assuming that the null hypothesis is true. The E-value is the product of the number of tests and the p-value.
The 'inflated' (or adjusted) p-value, is when a group of p-values are changed according to some multiple comparisons procedure so that each of the adjusted p-values can now be compared to the same threshold level of significance (α), while keeping the type I error controlled. The control is in the sense that the specific procedures controls it, it might be controlling the familywise error rate, the false discovery rate, or some other error rate.
See also 
- False discovery rate
- Fisher's method
- Generalized p-value
- Statistical hypothesis testing
- Odds of TT is odds of HT and TH are and which are equal, and adding these yield
- To be precise the p = 0.05 corresponds to about 1.96 standard deviations for a normal distribution (two-tailed test), and 2 standard deviations corresponds to about a 1 in 22 chance of being exceeded by chance, or p ≈ 0.045; Fisher notes these approximations.
- Goodman, SN (1999). "Toward Evidence-Based Medical Statistics. 1: The P Value Fallacy.". Annals of Internal Medicine 130: 995–1004.
- Stigler 2008.
- Dallal 2012, Note 31: Why P=0.05?.
- Hubbard & Lindsay 2008.
- Wetzels, R.; Matzke, D.; Lee, M. D.; Rouder, J. N.; Iverson, G. J.; Wagenmakers, E. -J. (2011). "Statistical Evidence in Experimental Psychology: An Empirical Comparison Using 855 t Tests". Perspectives on Psychological Science 6 (3): 291. doi:10.1177/1745691611406923.
- Babbie, E. (2007). The practice of social research 11th ed. Thomson Wadsworth: Belmont, CA.
- Stigler 1986, p. 134.
- Pearson 1900.
- Inman 2004.
- Hubbard & Bayarri 2003, p. 1.
- Fisher 1925, p. 47, Chapter III. Distributions.
- Fisher 1925, pp. 78–79, 98, Chapter IV. Tests of Goodness of Fit, Independence and Homogeneity; with Table of χ2, Table III. Table of χ2.
- Fisher 1971, II. The Principles of Experimentation, Illustrated by a Psycho-physical Experiment.
- Fisher 1971, Section 7. The Test of Significance.
- Fisher 1971, Section 12.1 Scientific Inference and Acceptance Procedures.
- Sterne, J. A. C.; Smith, G. Davey (2001). "Sifting the evidence–what's wrong with significance tests?". BMJ (Clinical research ed.) 322 (7280): 226–231. doi:10.1136/bmj.322.7280.226. PMC 1119478. PMID 11159626.
- Schervish, M. J. (1996). "P Values: What They Are and What They Are Not". The American Statistician 50 (3). doi:10.2307/2684655. JSTOR 2684655.
- Casella, George; Berger, Roger L. (1987). "Reconciling Bayesian and Frequentist Evidence in the One-Sided Testing Problem". Journal of the American Statistical Association 82 (397): 106–111.
- Sellke, Thomas; Bayarri, M. J.; Berger, James O. (2001). "Calibration of p Values for Testing Precise Null Hypotheses". The American Statistician 55 (1): 62–71. doi:10.1198/000313001300339950. JSTOR 2685531.
- Casson, R. J. (2011). "The pesty P value". Clinical & Experimental Ophthalmology 39 (9): 849–850. doi:10.1111/j.1442-9071.2011.02707.x.
- Johnson, D. H. (1999). "The Insignificance of Statistical Significance Testing". Journal of Wildlife Management 63 (3): 763–772. doi:10.2307/3802789.
- National Institutes of Health definition of E-value
- Hochberg, Y.; Benjamini, Y. (1990). "More powerful procedures for multiple significance testing". Statistics in Medicine 9 (7): 811–818. doi:10.1002/sim.4780090710. PMID 2218183. (page 815, second paragraph)
- Pearson, Karl (1900). "On the criterion that a given system of deviations from the probable in the case of a correlated system of variables is such that it can be reasonably supposed to have arisen from random sampling". Philosophical Magazine Series 5 50 (302): 157–175. doi:10.1080/14786440009463897.
- Elderton, William Palin (1902). "Tables for Testing the Goodness of Fit of Theory to Observation". Biometrika 1 (2): 155–163. doi:10.1093/biomet/1.2.155.
- Fisher, Ronald (1925). Statistical Methods for Research Workers. Edinburgh: Oliver & Boyd. ISBN 0-05-002170-2.
- Fisher, Ronald A. (1971) . The Design of Experiments (9th ed.). Macmillan. ISBN 0-02-844690-9.
- Fisher, R. A.; Yates, F. (1938). Statistical tables for biological, agricultural and medical research. London.
- Stigler, Stephen M. (1986). The history of statistics : the measurement of uncertainty before 1900. Cambridge, Mass: Belknap Press of Harvard University Press. ISBN 0-674-40340-1.
- Hubbard, Raymond; Bayarri, M. J. (November 2003), P Values are not Error Probabilities, a working paper that explains the difference between Fisher's evidential p-value and the Neyman–Pearson Type I error rate α.
- Hubbard, Raymond; Armstrong, J. Scott (2006). "Why We Don't Really Know What Statistical Significance Means: Implications for Educators". Journal of Marketing Education 28 (2): 114. doi:10.1177/0273475306288399.
- Hubbard, Raymond; Lindsay, R. Murray (2008). "Why P Values Are Not a Useful Measure of Evidence in Statistical Significance Testing". Theory & Psychology 18 (1): 69–88. doi:10.1177/0959354307086923.
- Stigler, Stephen (December 2008). "Fisher and the 5% level". Chance 21 (4): 12. doi:10.1007/s00144-008-0033-3.
- Dallal, Gerard E. (2012). The Little Handbook of Statistical Practice.
Further reading 
- Free online p-values calculators for various specific tests (chi-square, Fisher's F-test, etc.).
- Understanding p-values, including a Java applet that illustrates how the numerical values of p-values can give quite misleading impressions about the truth or falsity of the hypothesis under test.