G-Test Calculator

Calculate the G-test (likelihood ratio test) for contingency tables

Try It Free

What is the G-Test?

The G-test (also called the likelihood ratio test or log-likelihood ratio test) is an alternative to the chi-square test for testing independence in contingency tables. It uses a logarithmic formula based on the ratio of observed to expected frequencies. The G-test is preferred by many statisticians because it has better theoretical properties and is additive (partitionable).

G-Test Formula

The G statistic is calculated as:

G = 2 Σ O × ln(O/E)

G-Test vs. Chi-Square

Both tests are asymptotically equivalent, meaning they give similar results for large samples. Key differences:

When to Use the G-Test

Use the G-test when: (1) you need to partition a multi-way table into components, (2) you prefer maximum likelihood methods, or (3) you want to use information-theoretic approaches. The chi-square test and G-test will rarely disagree in practice.

Frequently Asked Questions

Is the G-test better than chi-square?

Neither is universally better. The G-test has better theoretical properties (additivity, connection to maximum likelihood), but chi-square is more widely recognized. For most practical purposes they give very similar results. CrossTabs.com computes both.

Can I use the G-test for small samples?

Like chi-square, the G-test uses a chi-square distribution approximation that requires adequate expected cell counts (generally ≥ 5). For small samples, Fisher's exact test is preferred.

How do I report the G-test?

Report as: G(df) = value, p = value. For example: G(2) = 12.45, p = .002. Some journals prefer "likelihood ratio chi-square" or "LR χ²" as the label.