In a test, a researcher computes the observed statistic and then randomly generates 999 comparison results under the null hypothesis. If none of them is at least as extreme as the observed value, computing the proportion as 0/999 is correct as far as it goes, but p = 0 should not be reported directly. Zero hits describes these 999 draws; turning it into a p-value for testing also requires considering where the observed result sits among all the comparison results. By the commonly used add-one formula, the result is 1/1000 = 0.001.[1]

Estimating a tail proportion versus calibrating a single test

Let m be the number of randomly generated comparison results and B the number of them that are at least as extreme as the observed result. With the current observed result held fixed, B/m is an estimate of the corresponding null tail probability: more draws usually allow this proportion to be estimated more finely. But comparing B/m directly with the significance level α is a different matter. Even an estimator that is unbiased on average can fall too low through random fluctuation, making the rejection probability exceed the preset level when the null hypothesis is true.[1]

The added one comes from the discrete rank of the observed result

Start with a case that is easy to derive: the null hypothesis is true, and the observed statistic and m independent simulated statistics come from the same continuous distribution. Sort these m + 1 numbers from most extreme to least extreme; the observed value has no special position and falls at each rank with probability 1/(m + 1). If B simulated values are more extreme than it, its rank is B + 1. The proportion of ranks at least as far forward as that of the current observed value is therefore

p = (B + 1)/(m + 1).

The one added to the denominator puts the observed result into the comparison set as well; the one added to the numerator is there because the observed result is at least as extreme as itself. When B = 0, it ranks first, and the corresponding probability is 1/(m + 1), not 0. In the setting above, with continuous independent simulations, this is exactly the exact discrete p-value of a finite Monte Carlo test.[1]

This difference in rank also changes the long-run error rate. The figure below is computed under the continuous null hypothesis described above: when m = 20 and the nominal significance level is 0.05, B is equally likely to be any of the 21 integers from 0 to 20. Rejecting when B/20 ≤ 0.05 means rejecting when B = 0 or 1, with probability 2/21, about 9.52%; rejecting when (B + 1)/21 ≤ 0.05 means rejecting only when B = 0, with probability 1/21, about 4.76%. The former exceeds the nominal level; the latter is controlled at that level.[1]

Step curves comparing the actual error rates of the two calculation methods with the nominal significance level

Figure: Illustration computed from the formulas for m = 20 under a continuous null hypothesis. The rejection probabilities of the two methods are computed from the discrete uniform distribution of B = 0, …, 20; the method follows Phipson and Smyth.[1]

How random permutations are drawn affects what "exact" means

A permutation test has to distinguish how the permutations are drawn. In the without-replacement case discussed in Section 5 of the paper, the permutations drawn correspond to statistics that are distinct from one another and also different from the original observed value; in that setting, the same discrete-rank argument gives the exact p-value (B + 1)/(m + 1). If all the permitted distinct results are enumerated, the original permutation is still a member of the complete comparison set.[1]

When drawing with replacement, the same permutation may appear more than once, and the original permutation may also be drawn. Section 6 of the paper gives the exact probability for a finite set of permutations: for each possible full-permutation tail probability, compute the cumulative binomial probability that B does not exceed the observed count, and then average over those possible values. In that setting, the add-one formula is still a valid p-value, but it may be conservative; it should not be described across the board as the exact formula for this finite with-replacement problem.[1]

How to read a result with zero hits

Returning to the example of 999 random comparisons, reporting the add-one p = 0.001 when B = 0 says that the observed result sits at the most extreme discrete rank among this finite set of comparisons; it is not the probability that the null hypothesis is true, nor does it represent an effect size. Increasing the number of randomizations lowers the smallest value the add-one formula can give: for example, with m = 9,999 the minimum is 0.0001. If a very small significance threshold is planned, the number of randomizations needs to be matched to the required resolution at the design stage.[1]

Before the actual computation, the statistic and the rule for "at least as extreme" must be settled; a two-sided test in particular requires defining in advance how the two sides are combined, and counting equal results according to the chosen rule. The permutation scheme must also be consistent with the exchangeability of the data under the null hypothesis. Adding one addresses the calibration of a finite number of random comparisons; it cannot rescue an inappropriate permutation scheme.[1]

References

  1. [1] Phipson, B., & Smyth, G. K. (2010; corrected 9 February 2011). Permutation P-values Should Never Be Zero: Calculating Exact P-values When Permutations Are Randomly Drawn. Statistical Applications in Genetics and Molecular Biology, 9(1), Article 39. DOI: 10.2202/1544-6115.1585.