Jump to content

G-test

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Seglea (talk | contribs) at 12:39, 20 August 2004 (basics; not time to find out how to format the maths or isbn properly, can anyone help?). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

In statistics, G-tests are likelihood ratio or maximum likelihood statistics that are increasingly being used in situations where the chi-squared tests were previously recommended.

The commonly used chi-squared tests for goodness of fit to a distribution and for independence in contingency tables are in fact approximations of the log-likelihood ratio on which the G-tests are based. This approximation was developed by Karl Pearson at the time it was not feasible to calculate log-likelihood ratios. With the advent of electronic calculators and personal computers, this is no longer a problem, and G-tests are coming into increasing use, particularly since they were recommended in the 1994 edition of the popular statistics text book by Sokal and Rohlf.

The general formula for the chi-squared test statistic is

Chi-squared = Sum across all cells [(O-E)squared/E]

where O is the frequency observed in a cell and E is the frequency expected on the null hypothesis. The corresponding general formula for G is

G = 2 * Sum across all cells [ln (O/E)]

where ln denotes the natural logarithm (log to the base e.

On the null hypothesis that the observed frequencies result from random sampling from a distribution with the given expected frequencies, the distribution of G is approximately that of chi-squared, with the same number of degrees of freedom as in the corresponding chi-squared test.

For samples of a reasonable size, the G-test and the chi-squared test will lead to the same conclusions. However, the approximation to the theoretical distribution for the G-test is better than for the chi-squared test in cases where for any cell |O-E| > E, and in any such case the G-test should always be used.

For very small samples, Fisher's exact test is preferable to either the chi-squared test or the G-test.

References

  • Sokal, R. R., & Rohlf, F. J. (1994). Biometry: the principles and practice of statistics in biological research., 3rd edition. New York: Freeman. ISBN: 0-7167-2411-1.