Skip to content

Pearson's method

Maurice HT Ling edited this page Aug 14, 2021 · 1 revision

Purpose: To combine p-values from independent on the same hypothesis into a single p-value.

Code: Combine results of (1) Chi-Square test, (2) Cramér-von Mises test, (3) Cressie-Read power divergence test, (4) Epps-Singleton test, (5) Freeman-Tukey test, (6) G-test, (7), Kolmogorov-Smirnov test, and (8) Neyman's test of goodness of fit

>>> from scipy import stats
>>> observed = [16, 18, 16, 14, 12, 12]
>>> expected = [16, 16, 16, 16, 16, 8]
>>> pvalues = [stats.chisquare(observed, expected)[1],
               stats.cramervonmises_2samp(observed, expected).pvalue,
               stats.power_divergence(observed, expected, lambda_="cressie-read").pvalue,
               stats.epps_singleton_2samp(observed, expected).pvalue,
               stats.power_divergence(observed, expected, lambda_="freeman-tukey").pvalue,
               stats.power_divergence(observed, expected, lambda_="log-likelihood").pvalue,
               stats.ks_2samp(observed, expected).pvalue,
               stats.power_divergence(observed, expected, lambda_="neyman").pvalue]
>>> result = stats.combine_pvalues(pvalues, method="pearson")
>>> print("statistic = %.3f" % result[0])
statistic = 17.317
>>> print("p-value = %.3f" % result[1])
p-value = 0.365

Reference:

  1. Heard N, Rubin-Delanchey P. 2018. Choosing between methods of combining p-values. Biometrika 105(1), 239-246.
Clone this wiki locally