Multinomial test

From HandWiki

In statistics, the multinomial test is the test of the null hypothesis that the parameters of a multinomial distribution equal specified values; it is used for categorical data.[1] Beginning with a sample of [math]\displaystyle{ ~ N ~ }[/math] items each of which has been observed to fall into one of [math]\displaystyle{ k }[/math] categories. It is possible to define [math]\displaystyle{ ~ \mathbf{x} = (x_1, x_2, \dots, x_k) ~ }[/math] as the observed numbers of items in each cell. Hence [math]\displaystyle{ ~ \sum_{i=1}^k x_{i} = N ~. }[/math]

Next, defining a vector of parameters [math]\displaystyle{ ~ H_0: \boldsymbol{\pi} = (\pi_{1}, \pi_{2}, \ldots, \pi_{k}) ~, }[/math] where: [math]\displaystyle{ ~ \sum_{i=1}^k \pi_{i} = 1 ~. }[/math] These are the parameter values under the null hypothesis.

The exact probability of the observed configuration [math]\displaystyle{ ~ \mathbf{x} ~ }[/math] under the null hypothesis is given by

[math]\displaystyle{ ~ \operatorname\mathbb{P}\left( \mathbf{x}\right )_0 = N! \, \prod_{i=1}^k \frac{\pi_{i}^{x_i}}{x_i!} ~. }[/math]

The significance probability for the test is the probability of occurrence of the data set observed, or of a data set less likely than that observed, if the null hypothesis is true. Using an exact test, this is calculated as

[math]\displaystyle{ ~ p_\mathcal{[sig]} = \sum_{ \mathbf{y} \, : \; \operatorname{\mathbb{P}}\left( \mathbf{y} \right) \, \le \, \operatorname{\mathbb{P}}\left( \mathbf{x} \right)_0 } \operatorname\mathbb{P}\left( \mathbf{y}\right) ~ }[/math]

where the sum ranges over all outcomes as likely as, or less likely than, that observed. In practice this becomes computationally onerous as [math]\displaystyle{ ~ k ~ }[/math] and [math]\displaystyle{ ~ N ~ }[/math] increase so it is probably only worth using exact tests for small samples. For larger samples, asymptotic approximations are accurate enough and easier to calculate.

One of these approximations is the likelihood ratio. An alternative hypothesis can be defined under which each value [math]\displaystyle{ ~ \pi_{i} ~ }[/math] is replaced by its maximum likelihood estimate [math]\displaystyle{ ~ p_{i}=\frac{\;x_i\,}{N} ~. }[/math] The exact probability of the observed configuration [math]\displaystyle{ ~ \mathbf{x} ~ }[/math] under the alternative hypothesis is given by

[math]\displaystyle{ ~ \operatorname\mathbb{P}\left(\mathbf{x}\right)_A = N! \; \prod_{i=1}^k \frac{\;p_{i}^{x_i}\,}{x_i!} ~. }[/math]

The natural logarithm of the likelihood ratio, [math]\displaystyle{ ~[\mathcal{LR}]~, }[/math] between these two probabilities, multiplied by [math]\displaystyle{ ~ -2 ~, }[/math] is then the statistic for the likelihood ratio test

[math]\displaystyle{ ~ -2\ln([\mathcal{LR}]) = -2 \; \sum_{i=1}^k x_{i}\ln\left( \frac{\pi_i}{p_i}\right) ~. }[/math]

(The factor [math]\displaystyle{ ~ -2 ~ }[/math] is chosen to make the statistic asymptotically chi-squared distributed, for convenient comparison to a familiar statistic commonly used for the same application.)

If the null hypothesis is true, then as [math]\displaystyle{ ~ N ~ }[/math] increases, the distribution of [math]\displaystyle{ ~ -2\ln([\mathcal{LR}]) ~ }[/math] converges to that of chi-squared with [math]\displaystyle{ ~ k - 1 ~ }[/math] degrees of freedom. However it has long been known (e.g. Lawley[2]) that for finite sample sizes, the moments of [math]\displaystyle{ ~ -2\ln([\mathcal{LR}]) ~ }[/math] are greater than those of chi-squared, thus inflating the probability of type I errors (false positives). The difference between the moments of chi-squared and those of the test statistic are a function of [math]\displaystyle{ ~ N^{-1} ~. }[/math] Williams[3] showed that the first moment can be matched as far as [math]\displaystyle{ ~ N^{-2} ~ }[/math] if the test statistic is divided by a factor given by

[math]\displaystyle{ ~ q_1 = 1 + \frac{\;\sum_{i=1}^k \pi_{i}^{-1} \,-\, 1\;}{6N(k-1)} ~. }[/math]

In the special case where the null hypothesis is that all the values [math]\displaystyle{ \pi_{i} }[/math] are equal to [math]\displaystyle{ ~ 1 / k ~ }[/math] (i.e. it stipulates a uniform distribution), this simplifies to

[math]\displaystyle{ ~ q_1 = 1 + \frac{\,k+1\,}{\,6N\,} ~. }[/math]

Subsequently, Smith et al.[4] derived a dividing factor which matches the first moment as far as [math]\displaystyle{ ~ N^{-3} ~. }[/math] For the case of equal values of [math]\displaystyle{ ~ \pi_{i} ~, }[/math] this factor is

[math]\displaystyle{ ~ q_2 = 1 + \frac{\,k+1\,}{\,6N\,}+\frac{\;k^2\,}{\;6N^2\,} ~. }[/math]

The null hypothesis can also be tested by using Pearson's chi-squared test

[math]\displaystyle{ ~ \chi^2 = \sum_{i=1}^{k} \frac{\;(x_i - E_i)^2\,}{E_i} ~ }[/math]

where [math]\displaystyle{ ~ E_i = N \pi_i ~ }[/math] is the expected number of cases in category [math]\displaystyle{ ~ i ~ }[/math] under the null hypothesis. This statistic also converges to a chi-squared distribution with [math]\displaystyle{ ~ k - 1 ~ }[/math] degrees of freedom when the null hypothesis is true but does so from below, as it were, rather than from above as [math]\displaystyle{ ~ -2\ln([\mathcal{LR}]) ~ }[/math] does, so may be preferable to the uncorrected version of [math]\displaystyle{ ~ -2\ln([\mathcal{LR}]) ~ }[/math] for small samples.[citation needed]

References

  1. Read, T.R.C.; Cressie, N.A.C. (1988). Goodness-of-Fit Statistics for Discrete Multivariate Data. New York, NY: Springer-Verlag. ISBN 0-387-96682-X. 
  2. Lawley, D.N. (1956). "A general method of approximating to the distribution of likelihood ratio criteria". Biometrika 43: 295–303. doi:10.1093/biomet/43.3-4.295. 
  3. Williams, D.A. (1976). "Improved Likelihood Ratio Tests for Complete Contingency Tables". Biometrika 63: 33–37. doi:10.1093/biomet/63.1.33. 
  4. Smith, P.J.; Rae, D.S.; Manderscheid, R.W.; Manderscheid, S. (1981). "Approximating the moments and distribution of the likelihood ratio statistic for multinomial goodness of fit". Journal of the American Statistical Association (American Statistical Association) 76 (375): 737–740. doi:10.2307/2287541.