Power Divergence Test¶

PowerDivergenceTest
(x [,y] [, lambda] [,theta0] )¶ If
x
is a matrix with one row or column, or ifx
is a vector andy
is not given, then a goodnessoffit test is performed (x
is treated as a one dimensional contingency table. The entries ofx
must be nonnegative integers. In this case, the hypothesis tested is whether the population probabilities equal those intheta0
, or are all equal iftheta0
is not given.If
x
is a matrix with at least two rows and columns, it is taken as a twodimensional contigency table: the entries ofx
must be nonnegative integers. Otherwise,x
andy
must be vectors of the same length. The contigency table is calculated usingcounts
fromStatsbase
. Then the power divergence test is performed of the null hypothesis that the joint distribution of the cell counts in a 2dimensional contingency table is the product of the row and column marginals.The power divergence test is given by
\[\dfrac{2}{\lambda(\lambda+1)}\sum_{i=1}^I \sum_{j=1}^J n_{ij}\left[(n_{ij}/\hat{n}_{ij})^\lambda 1\right]\]where \(n_{ij}\) is the cell count in the \({i}\) th row and \({j}\) th column and \(\lambda\) is a real number. Note that when \(\lambda = 1\), this is equal to Pearson’s chisquared statistic, as :math`lambda to 0`, it converges to the likelihood ratio test statistic, as \(\lambda \to 1\) it converges to the minimum discrimination information statistic (Gokhale and Kullback 1978), for \(\lambda=2\) it equals Neyman modified chisquared (Neyman 1949), and for \(\lambda=1/2\) it equals the FreemanTukey statistic (Freeman and Tukey 1950). Under regulairty conditions, their asymptotic distributions are identical (see Drost et. al. 1989). The chissquared null approximation works best for \(\lambda\) near \({2/3}\).
Implements: pvalue, confint
References:
 Agresti, Alan. Categorical Data Analysis, 3rd Edition. Wiley, 2013.

ChisqTest
(x [,y] [,theta0])¶ Convenience function for power divergence test with \(\lambda=1\).

MultinomialLRT
(x [,y] [,theta0])¶ Convenience function for power divergence test with \(\lambda=0\).