P-value
In statistical significance testing, the p-value is the largest probability of obtaining test results at least as extreme as the results actually observed, under the assumption that the null hypothesis is correct.. A very small p-value means that such an extreme observed outcome is very unlikely under the null hypothesis. Reporting p-values of statistical tests is common practice in academic publications of many quantitative fields. Since the precise meaning of p-value is hard to grasp, misuse is widespread and has been a major topic in metascience.
Basic concepts
In statistics, every conjecture concerning the unknown probability distribution of a collection of random variables representing the observed data in some study is called a statistical hypothesis. If we state one hypothesis only and the aim of the statistical test is to see whether this hypothesis is tenable, but not, at the same time, to investigate other hypotheses, then such a test is called a significance test. Note that the hypothesis might specify the probability distribution of precisely, or it might only specify that it belongs to some class of distributions. Often, we reduce the data to a single numerical statistic whose marginal probability distribution is closely connected to a main question of interest in the study.A statistical hypothesis that refers only to the numerical values of unknown parameters of the distribution of some statistic is called a parametric hypothesis. A hypothesis which specifies the distribution of the statistic uniquely is called simple, otherwise it is called composite. Methods of verifying statistical hypotheses are called statistical tests. Tests of parametric hypotheses are called parametric tests. We can likewise also have non-parametric hypotheses and non-parametric tests.
The p-value is used in the context of null hypothesis testing in order to quantify the idea of statistical significance of evidence, the evidence being the observed value of the chosen statistic. Null hypothesis testing is a reductio ad absurdum argument adapted to statistics. In essence, a claim is assumed valid if its counterclaim is highly implausible.
Thus, the only hypothesis that needs to be specified in this test and which embodies the counterclaim is referred to as the null hypothesis; that is, the hypothesis to be nullified. A result is said to be statistically significant if it allows us to reject the null hypothesis. The result, being statistically significant, was highly improbable if the null hypothesis is assumed to be true. A rejection of the null hypothesis implies that the correct hypothesis lies in the logical complement of the null hypothesis. But no specific alternatives need to have been specified. The rejection of the null hypothesis does not tell us which of any possible alternatives might be better supported. However, the user of the test chose the test statistic in the first place probably with particular alternatives in mind; such a test if often used precisely in order to convince people that those alternatives are viable because what was actually observed was extremely unlikely under the null hypothesis.
As a particular example, if a null hypothesis states that a certain summary statistic follows the standard normal distribution N, then the rejection of this null hypothesis could mean that the mean is not 0, or the variance is not 1, or the distribution is not normal. Different tests of the same null hypothesis would be more or less sensitive to different alternatives. Anyway, if we do manage to reject the null hypothesis, even if we know the distribution is normal and variance is 1, the null hypothesis test does not tell us which non-zero values of the mean are now most plausible. If one has a huge amount of independent observations from the same probability distribution, one will eventually be able to show that their mean value is not precisely equal to zero; but the deviation from zero could be so small as to have no practical or scientific interest.
If is a real-valued random variable representing some function of the observed data, to be used as a test-statistic for testing a hypothesis because large values of would seem to discredit the hypothesis, and if it happens to take on the actual value, then the p-value of the so called one-sided test of the null-hypothesis based on that test-statistic is the largest value of the probability that could be larger than or equal to if is true.
Definition and interpretation
General
The p-value is defined as the best probability, under the null hypothesis about the unknown distribution of the test statistic, to have observed a value as extreme or more extreme than the value actually observed. If is the observed value, then very often, "as extreme or more extreme than what was actually observed" means , but one often also looks at outcomes which are extreme in the other direction, or which are extreme in either direction. If the null hypothesis specifies the probability distribution of the test statistic uniquely, then the p-value is given by- for a one-sided test,
- for a one-sided test,
- for a two-sided test,
If the p-value is very small, then the statistical significance is thought to be very large: under the hypothesis under consideration, something very unlikely has occurred. The investigator who is performing the test probably chose it precisely because he or she wants to discredit the null hypothesis by giving evidence that an alternative explanation of the data should be sought. In a formal significance test, The null hypothesis is rejected if, under the null hypothesis, the probability of such an extreme value as that which was actually observed is less than or equal to a small, fixed pre-defined threshold value, which is referred to as the level of significance. Unlike the p-value, the level is not derived from any observational data and does not depend on the underlying hypothesis; the value of is instead set by the researcher before examining the data. The setting of is arbitrary. By convention, is commonly set to 0.05, 0.01, 0.005, or 0.001.
The p-value is a function of the chosen test statistic and is therefore a random variable in itself. If the null hypothesis fixes the probability distribution of precisely, and if that distribution is continuous, then when the null-hypothesis is true, the p-value is uniformly distributed between 0 and 1, and observing it to take on a value very close to 0 is thought to discredit the hypothesis. Thus, the p-value is not fixed. If the same test is repeated independently with fresh data, one will find different p-values at every repetition. If the null-hypothesis is composite, or the distribution of the statistic is discrete, the probability of obtaining a p-value less than or equal to any number between 0 and 1 is less than or equal to that number, if the null-hypothesis is true. It remains the case that very small values are very unlikely if the null-hypothesis is true, and that a significance test at level is obtained by rejecting the null-hypothesis if the significance level is less than or equal to.
Different p-values based on independent sets of data can be combined, for instance using Fisher's combined probability test.
Distribution
When the null hypothesis is true, if it takes the form, and the underlying random variable is continuous, then the probability distribution of the p-value is uniform on the interval . By contrast, if the alternative hypothesis is true, the distribution is dependent on sample size and the true value of the parameter being studied.The distribution of p-values for a group of studies is sometimes called a p-curve. The curve is affected by four factors: the proportion of studies that examined false null hypotheses, the power of the studies that investigated false null hypotheses, the alpha levels, and publication bias. A p-curve can be used to assess the scientific literature, such as by detecting publication bias or p-hacking.
For composite hypothesis
In parametric hypothesis testing problems, a simple or point hypothesis refers to a hypothesis where the parameter's value is assumed to be a single number. In contrast, in a composite hypothesis the parameter's value is given by a set of numbers. For example, when testing the null hypothesis that a distribution is normal with a mean less than or equal to zero against the alternative that the mean is greater than zero, the null hypothesis does not specify the probability distribution of the appropriate test statistic. In the just mentioned example that would be the Z-statistic belonging to the one-sided one-sample Z-test. For each possible value of the theoretical mean, the Z-test statistic has a different probability distribution. In these circumstances the p-value is defined by taking the least favourable null-hypothesis case, which is typically on the border between null and alternative.Misconceptions
According to the ASA, there is widespread agreement that p-values are often misused and misinterpreted. One practice that has been particularly criticized is accepting the alternative hypothesis for any p-value nominally less than.05 without other supporting evidence. Although p-values are helpful in assessing how incompatible the data are with a specified statistical model, contextual factors must also be considered, such as "the design of a study, the quality of the measurements, the external evidence for the phenomenon under study, and the validity of assumptions that underlie the data analysis". Another concern is that the p-value is often misunderstood as being the probability that the null hypothesis is true. Some statisticians have proposed replacing p-values with alternative measures of evidence, such as confidence intervals, likelihood ratios, or Bayes factors, but there is heated debate on the feasibility of these alternatives. Others have suggested to remove fixed significance thresholds and to interpret p-values as continuous indices of the strength of evidence against the null hypothesis. Yet others suggested to report alongside p-values the prior probability of a real effect that would be required to obtain a false positive risk below a pre-specified threshold.Usage
The p-value is widely used in statistical hypothesis testing, specifically in null hypothesis significance testing. In this method, as part of experimental design, before performing the experiment, one first chooses a model and a threshold value for p, called the significance level of the test, traditionally 5% or 1% and denoted as α. If the p-value is less than the chosen significance level, that suggests that the observed data is sufficiently inconsistent with the null hypothesis and that the null hypothesis may be rejected. However, that does not prove that the tested hypothesis is true. When the p-value is calculated correctly, this test guarantees that the type I error rate is at most α. For typical analysis, using the standard α = 0.05 cutoff, the null hypothesis is rejected when p <.05 and not rejected when p >.05. The p-value does not, in itself, support reasoning about the probabilities of hypotheses but is only a tool for deciding whether to reject the null hypothesis.Calculation
Usually, is a test statistic, rather than any of the actual observations. A test statistic is the output of a scalar function of all the observations. This statistic provides a single number, such as the average or the correlation coefficient, that summarizes the characteristics of the data, in a way relevant to a particular inquiry. As such, the test statistic follows a distribution determined by the function used to define that test statistic and the distribution of the input observational data.For the important case in which the data are hypothesized to be a random sample from a normal distribution, depending on the nature of the test statistic and the hypotheses of interest about its distribution, different null hypothesis tests have been developed. Some such tests are the z-test for hypotheses concerning the mean of a normal distribution with known variance, the t-test based on Student's t-distribution of a suitable statistic for hypotheses concerning the mean of a normal distribution when the variance is unknown, the F-test based on the F-distribution of yet another statistic for hypotheses concerning the variance. For data of other nature, for instance categorical data, test statistics might be constructed whose null hypothesis distribution is based on normal approximations to appropriate statistics obtained by invoking the central limit theorem for large samples, as in the case of Pearson's chi-squared test.
Thus computing a p-value requires a null hypothesis, a test statistic, and data. Even though computing the test statistic on given data may be easy, computing the sampling distribution under the null hypothesis, and then computing its cumulative distribution function is often a difficult problem. Today, this computation is done using statistical software, often via numeric methods, but, 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.
Examples
Coin flipping
As an example of a statistical test, an experiment is performed to determine whether a coin flip is fair or unfairly biased.Suppose that the experimental results show the coin turning up heads 14 times out of 20 total flips. The full data would be a sequence of twenty times the symbol "H" or "T". The statistic on which one might focus, could be the total number of heads. The null hypothesis is that the coin is fair, and coin tosses are independent of one another. If a right-tailed test is considered, which would be the case if one is actually interested in the possibility that the coin is biased towards falling heads, then the p-value of this result is the chance of a fair coin landing on heads at least 14 times out of 20 flips. That probability can be computed from binomial coefficients as
This probability is the p-value, considering only extreme results that favor heads. This is called a one-tailed test. However, one might be interested in deviations in either direction, favoring either heads or tails. The two-tailed p-value, which considers deviations favoring either heads or tails, may instead be calculated. 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: the two-sided p-value is 0.115.
In the above example:
- Null hypothesis : The coin is fair, with Prob = 0.5
- Test statistic: Number of heads
- Alpha level : 0.05
- Observation O: 14 heads out of 20 flips; and
- Two-tailed p-value of observation O given H0 = 2*min, Prob)= 2*min = 2*0.058 = 0.115.
However, had one more head been obtained, the resulting p-value would have been 0.0414 , in which case the null hypothesis would be rejected at the.05 level.
History
Computations of p-values date back to the 1700s, where they were computed for the human sex ratio at birth, and used to compute statistical significance compared to the null hypothesis of equal probability of male and female births. John Arbuthnot studied this question in 1710, and examined birth records in London for each of the 82 years from 1629 to 1710. In every year, the number of males born in London exceeded the number of females. Considering more male or more female births as equally likely, the probability of the observed outcome is 0.582, or about 1 in 4,836,000,000,000,000,000,000,000; in modern terms, the p-value. This is vanishingly small, leading Arbuthnot that this was not due to chance, but to divine providence: "From whence it follows, that it is Art, not Chance, that governs." In modern terms, he rejected the null hypothesis of equally likely male and female births at the p = 1/282 significance level. This and other work by Arbuthnot is credited as "… the first use of significance tests …" the first example of reasoning about statistical significance, and "… perhaps the first published report of a nonparametric test …", specifically the sign test; see details at.The same question was later addressed by Pierre-Simon Laplace, who instead used a parametric test, modeling the number of male births with a binomial distribution:
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, now notated as P, was calculated in, collected in.
The use of the p-value in statistics was popularized by Ronald Fisher, and it plays a central role in his approach to the subject. In his influential book Statistical Methods for Research Workers, Fisher proposed the level p = 0.05, or a 1 in 20 chance of being exceeded by chance, as a limit for statistical significance, and applied this to a normal distribution, thus yielding the rule of two standard deviations for statistical significance.
He then computed a table of values, similar to Elderton but, importantly, reversed the roles of χ2 and p. That is, rather than computing p for different values of χ2, he computed 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. That allowed computed values of χ2 to be compared against cutoffs and encouraged the use of p-values as cutoffs, instead of computing and reporting p-values themselves. The same type of tables were then compiled in, 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, Fisher presented the lady tasting tea experiment, which is the archetypal example of the p-value.
To evaluate a lady's claim that she could distinguish by taste how tea is prepared, she was sequentially presented with 8 cups: 4 prepared one way, 4 prepared the other, and asked to determine the preparation of each cup. In that 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 if all were classified correctly.
Fisher reiterated the p = 0.05 threshold and explained its rationale, stating:
He also applies this threshold to the design of experiments, noting that had only 6 cups been presented, a perfect classification would have only yielded a p-value of which would not have met this level of significance. Fisher also underlined the 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.
Related quantities
A closely related concept is the E-value, which is the expected 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 if one assumes that the null hypothesis is true. The E-value is the product of the number of tests and the p-value.The q-value is the analog of the p-value with respect to the positive false discovery rate. It is used in multiple hypothesis testing to maintain statistical power while minimizing the false positive rate.