Skip to contents

Under the null that this year's top-\(k\) places are a uniformly random \(k\)-subset of the \(n\) places, independent of last year's, the number of places in both sets is hypergeometric: \(P(j) = C(k, j) C(n-k, k-j) / C(n, k)\) (Research.P7.Persistence.card_overlapSets, overlap_prob), the law sums to one (overlap_prob_sum) and its mean is \(k^2/n\).

Usage

morie_rank_persistence_null(n, k, observed = NULL)

Arguments

n

Number of places.

k

Size of the top set.

observed

Optional observed overlap; its upper tail probability under the null is returned.

Value

A list with law (a data frame of overlap and probability), mean (\(k^2/n\)), p_value (\(P(\mathrm{overlap} \ge \mathrm{observed})\), NA without observed) and theorems.

Examples

morie_rank_persistence_null(158, 16, observed = 9)$p_value
#> [1] 7.174976e-07