Statistics Glossary → G-test (likelihood-ratio chi-square, G²)
G-test (likelihood-ratio chi-square, G²)concept
The likelihood-ratio counterpart of Pearson's chi-square test, comparing observed and expected frequencies through their log ratios.
The statistic is G² = 2 Σ O · ln(O / E), where O is the observed and E the expected frequency under the null hypothesis. It approximately follows a chi-square distribution with the same degrees of freedom as Pearson's X², and in large samples the two give very similar results. G² is the likelihood-ratio test between the full (saturated) model and the null model; it is the same quantity as the deviance in log-linear and logistic models.
For nested models G² values can be added and subtracted, which makes it easy to partition a complex table into separate tests. In sparse tables with small expected frequencies both the G² and the X² approximations can break down; Fisher's exact test or a Monte Carlo p value is then more appropriate.
An everyday example
An ice-cream seller tests with 200 sales whether four flavours are equally popular, so 50 sales are expected for each. If the observed counts are 70, 50, 45 and 35, G² = 2[70 ln(1.4) + 50 ln(1) + 45 ln(0.9) + 35 ln(0.7)] ≈ 12.7; with 3 degrees of freedom this shows that the flavours are not equally popular (almost the same as Pearson's X² = 13.0).
In MerQur
The 'G-test, likelihood ratio' checkbox in Chi-Square Independence and the 'G-test' checkbox in Chi-Square Goodness of Fit make G² the main statistic; it is the likelihood-ratio test in the Crosstab, the goodness-of-fit and ΔG² statistic in the Log-Linear Model, part of the Pearson / Deviance goodness-of-fit extra output in Multinomial Logistic Regression, and one of the model fit measures in Latent Class Analysis.
Analyses where this concept appears
Chi-Square IndependenceChi-Square Goodness of FitLog-Linear ModelCrosstabMultinomial Logistic RegressionLatent Class Analysis (LCA)