{'fraction_non_alphanumeric': 0.019767441860465116, 'fraction_numerical': 0.0034883720930232558, 'mean_word_length': 4.74, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
The null distribution of Kendall's rank correlation statistic in the presence of ties

We present new techniques for computing exact p-values of Kendall’s rank correlation statistic when ties are present. An explicit formula for the probability-generating function of this statistic in the case of ties in one ranking is derived. This allows for computation of exact p-values for sample sizes up to 100, regardless of the tie structure. When ties are present in both rankings, one has to fall back on enumeration methods. We discuss how a large part of this enumeration can be avoided. The exact results for ties in one ranking are used to develop an efficient Monte Carlo simulation algorithm for approximating p-values in case of ties in both rankings. Finally, we shortly discuss computer implementations of our methods, which are available on the internet.