Likelihood Ratio Test Calculator

Test hypotheses using log-likelihood inputs or tables, fast. See LR statistic, degrees of freedom, significance. Download summaries, keep history, and share final evidence today.

Calculator
Choose a mode, enter inputs, and calculate instantly.
Reset

Select the type of likelihood ratio test you need.
Common choices: 0.10, 0.05, 0.01.
Controls rounding in the result panel and exports.
Log-likelihood of the restricted (null) model.
Log-likelihood of the full (alternative) model.
Number of estimated parameters in the null model.
Number of estimated parameters in the alternative model.
Used only for BIC. Leave blank to skip.
Quick check
Ensure the models are nested and fit to the same data. Degrees of freedom are computed as k1 − k0.
O11 O12
First row of a 2×2 contingency table.
O21 O22
Second row of a 2×2 contingency table.
Interpretation tip
The G-test compares observed and expected counts under independence. Very small expected counts may reduce accuracy.

Example data table
Use these example inputs to verify your setup and expected outputs.
Scenario Inputs Expected output (typical)
Nested models ℓ0 = -120.5, ℓ1 = -110.2, k0 = 3, k1 = 5, n = 200 LR ≈ 20.6, df = 2, p-value small, reject null.
2×2 G-test O11=12, O12=18, O21=20, O22=10 G statistic computed from observed vs expected; compare to χ²(1).
Exact p-values depend on rounding and the distribution approximation.
Formula used
Nested models (general likelihood ratio test)
Let ℓ0 be the null log-likelihood and ℓ1 the alternative log-likelihood.
  • LR = 2(ℓ1 − ℓ0)
  • df = k1 − k0 (difference in parameters)
  • Under standard conditions, LR ~ χ²(df) approximately.
  • p-value = P(χ²(df) ≥ LR) (right-tail probability)
2×2 contingency table (G-test)
Expected counts: Eij = (row_i total × col_j total) / n
  • G = 2 Σ Oij ln(Oij / Eij) (terms with Oij=0 contribute 0)
  • df = (r−1)(c−1) = 1 for 2×2
  • Approximate reference distribution: G ~ χ²(1)

This calculator computes chi-square probabilities using a regularized incomplete gamma function and uses a standard approximation for chi-square critical values.
How to use this calculator
  1. Select a calculation mode based on your data type.
  2. Enter the required inputs, then choose your significance level.
  3. Press Calculate to show results above the form.
  4. Review the test statistic, degrees of freedom, and p-value.
  5. Use CSV/PDF buttons to export results for reports.
  6. Check notes if you have small expected counts or unusual inputs.
FAQs

1) What does the likelihood ratio test compare?

It compares how well two models explain the same data. One model is usually a restricted special case of the other, so the test checks if extra parameters improve fit significantly.

2) Why is the statistic multiplied by 2?

Using 2(ℓ1−ℓ0) makes the statistic follow a chi-square distribution under standard large-sample conditions, enabling quick p-value calculations.

3) How do I choose degrees of freedom?

For nested models, use the difference in parameter counts: df = k1 − k0. For a 2×2 G-test, df is 1 because (2−1)(2−1)=1.

4) What if my alternative log-likelihood is smaller?

That can happen from convergence issues, different data, or non-nested models. The calculator truncates negative statistics to zero, but you should verify model fitting and assumptions.

5) When is the chi-square approximation unreliable?

It may be unreliable with small samples, boundary parameters, non-regular models, or very small expected counts in tables. In those cases, consider exact methods or simulation-based approaches.

6) Is the G-test the same as Pearson’s chi-square test?

They are closely related and often give similar conclusions. The G-test uses log ratios, while Pearson’s uses squared differences. Differences shrink as sample size increases.

7) What do ΔAIC and ΔBIC tell me here?

They compare model fit with penalties for complexity. Negative ΔAIC/ΔBIC favors the alternative model, while positive values favor the null. They are not hypothesis tests, but helpful model-selection summaries.

8) What should I report from an LRT?

Report the test statistic, degrees of freedom, p-value, and conclusion. Also mention the models compared and any relevant diagnostics, such as sample size or small expected counts.

Related Calculators

bayes risk calculatordecision boundary calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.