A statistic used in an alternative to the chi-squared test of goodness-of-fit. The two test statistics usually have similar values and both have approximate chi-squared distributions when the model under test is a correct description of the data. The G2 test is usually preferred when comparing hierarchical models. If the observed cell frequencies are denoted by O1, O2,…, Ok and the corresponding expected cell frequencies (see expected frequency) by E1, E2,…, Ek, respectively, G2 is given bywhere ln is the natural logarithm. The test results from the work of Neyman and Egon Pearson, who first used the term ‘likelihood ratio’ in a 1931 paper.