Tutorials › Generalized Linear Models › Sparse Data and Small-Sample Deviance Calibration

Nested Models and Deviance Tests · Tutorial 319 of 981

Sparse Data and Small-Sample Deviance Calibration

Assess when a deviance test’s chi-square p-value may be unreliable because counts are sparse or fitted probabilities are extreme.

Intermediate 12 min read

What You'll Learn

  • State the regularity conditions behind chi-square calibration of deviance differences
  • Explain why small expected counts can undermine the local quadratic approximation
  • Compare an exact binomial likelihood-ratio tail probability with its chi-square approximation
  • Calculate deviance contributions when Poisson counts are sparse
  • Recognize how extreme fitted probabilities can signal unreliable calibration
  • Interpret an asymptotic p-value as an approximation rather than an exact probability

Why Sparse Data Need a Calibration Check

A deviance difference can be calculated exactly from fitted likelihoods, yet its reference distribution under the null is usually approximate. In regular, sufficiently informative problems, Wilks’ theorem gives a chi-square limit. Sparse data can make that approximation poor: the likelihood may be far from quadratic near its maximum, some fitted probabilities may be close to zero or one, or a few observations may carry most of the information.

This distinction matters in practice. A reported deviance difference is a statistic; its p-value also depends on a reference distribution. If the chi-square approximation is inaccurate, the p-value can suggest more or less evidence against the null than the data warrant. There is no universal expected-count threshold that guarantees a good approximation in every GLM. The structure of the model, the number of sparse groups, and the fitted values all matter.

Definition: A sparse-data calibration problem occurs when a deviance statistic is compared with its usual chi-square reference distribution even though the data provide too little information for that approximation to be dependable. Warning signs include small expected counts in groups or cells, many zero counts, fitted probabilities near zero or one, and parameter estimates driven by only a few observations.

For a nested-model likelihood-ratio test, the statistic is the difference in deviances, equivalently twice the difference in maximized log-likelihoods. The usual chi-square calibration is justified asymptotically when the null is true, the models are regular and identifiable, the null parameter lies in the interior of the larger model’s parameter space, the relevant information grows, and the dimensions being compared remain fixed. Under those conditions, the statistic converges in distribution to a chi-square random variable with degrees of freedom equal to the dimension difference. Sparse samples can make this large-sample approximation inaccurate even when the statistic and its nominal degrees of freedom are computed correctly.

Why Small Expected Counts Are a Warning

One reason chi-square approximations arise is that, near its maximum, a log-likelihood can often be approximated by a quadratic function. A quadratic approximation is most useful when the data contain enough information for the likelihood to be locally smooth and well concentrated. In sparse settings, the observed counts may be far from their expected values relative to the expected values themselves. Then the local quadratic description can be poor.

The Poisson deviance contribution for an observed count \(y\) and fitted mean \(\mu>0\) is \(2\{y\log(y/\mu)-(y-\mu)\}\), with \(0\log 0=0\). Its relation to the Pearson contribution can be seen by writing \(y=\mu(1+u)\), where \(u=(y-\mu)/\mu\). For \(u\) near zero, a Taylor expansion gives \(2\mu\{(1+u)\log(1+u)-u\}\approx \mu u^2=(y-\mu)^2/\mu\). The approximation relies on \(u\) being small; when \(y=0\), \(u=-1\), which is not a small deviation.

Result: If \(y/\mu\) is close to one, the Poisson deviance contribution is approximately the Pearson contribution. This is a local approximation, not an identity. In particular, a zero count with small positive \(\mu\) is not a small relative deviation: its relative deviation is exactly \(-1\).

Worked Example: A Sparse Poisson Count

Suppose one group has observed count \(y=0\) and fitted Poisson mean \(\mu=0.5\). Compare its deviance and Pearson contributions, then calculate how likely a zero is under that fitted mean.

For the deviance contribution, use the convention \(0\log 0=0\):

$$ 2\{y\log(y/\mu)-(y-\mu)\} =2\{0-(0-0.5)\}=1. $$

The Pearson contribution is:

$$ \frac{(y-\mu)^2}{\mu} =\frac{(0-0.5)^2}{0.5}=0.5. $$

These contributions differ by a factor of two in this example. Also, if \(Y\) has a Poisson distribution with mean \(0.5\), then \(P(Y=0)=e^{-0.5}\approx0.6065\). Thus, a zero is not surprising under this small mean, but its relative deviation from the mean is large. A quadratic approximation to the contribution should not be assumed accurate merely because the model supplies a fitted mean.

Worked Comparison: Exact and Chi-Square Calibration

A small binomial problem gives a direct way to see how calibration can change a p-value. Consider \(X\sim\operatorname{Binomial}(10,p)\) and test \(H_0:p=0.5\) against the unrestricted alternative. The saturated model estimates \(p\) by \(\hat p=X/10\). For an observation \(x\), the likelihood-ratio deviance is

$$ D(x)=2\left\{x\log\left(\frac{x/10}{0.5}\right) +(10-x)\log\left(\frac{1-x/10}{0.5}\right)\right\}, $$

where terms with a zero count are interpreted by continuity.

Worked Example: A Binomial Test With Ten Trials

Suppose the observed count is \(x=1\). Calculate the deviance, its chi-square p-value, and the exact null tail probability based on the likelihood-ratio statistic.

The unrestricted estimate is \(\hat p=1/10=0.1\). Therefore:

$$ D(1)=2\left\{\log(0.1/0.5)+9\log(0.9/0.5)\right\} =2\{-1.609438+9(0.587787)\} \approx 7.361. $$

Using a chi-square distribution with one degree of freedom gives \(P(\chi^2_1\ge7.361)\approx0.0067\). This is an asymptotic p-value.

For the exact null calculation, under \(p=0.5\), each outcome \(x\) has probability \(\binom{10}{x}/2^{10}\). The deviance is symmetric around 5 and increases as \(x\) moves farther from 5. Thus, outcomes with a deviance at least as large as \(D(1)\) are \(0,1,9,10\). Their total null probability is:

$$ P(X\in\{0,1,9,10\}\mid H_0) =\frac{1+10+10+1}{2^{10}} =\frac{22}{1024}\approx0.0215. $$

Here the exact likelihood-ratio tail probability is more than three times the chi-square approximation. This is a concrete illustration of calibration error, not evidence that one universal adjustment factor applies to sparse binomial tests.

Extreme Fitted Probabilities

In binomial and binary-response GLMs, extreme fitted probabilities are another warning sign. If a fitted probability is near zero or one, the likelihood can be highly asymmetric, and a coefficient estimate may depend heavily on a small number of events. In some data sets, an unrestricted logistic model has no finite maximum-likelihood coefficient because a predictor separates successes from failures. The likelihood-ratio statistic may still have a finite limiting value, but the usual regularity conditions behind the chi-square approximation do not automatically hold.

A boundary estimate is not by itself a proof that a particular p-value is badly wrong. It is a reason to examine the data and the assumptions behind the reference distribution rather than treating the chi-square result as exact. The relevant question is whether the sample supplies the regular, growing information that makes the asymptotic approximation credible.

Worked Example: A Group With No Events

Two groups each contain eight subjects. Group A has 0 events and 8 non-events; group B has 4 events and 4 non-events. Test the null model of a common event probability against a model with a separate probability for each group, using the likelihood-ratio deviance difference.

Under the null, the pooled event proportion is \(4/16=0.25\). The fitted expected counts in each group are therefore 2 events and 6 non-events. The alternative fits proportions 0 in group A and \(4/8=0.5\) in group B. The deviance difference is:

$$ \begin{aligned} D &=2\left\{0\log(0/2)+8\log(8/6) +4\log(4/2)+4\log(4/6)\right\}\\ &=2\left\{0+8(0.287682)+4(0.693147)+4(-0.405465)\right\}\\ &\approx 6.904. \end{aligned} $$

The nominal degrees of freedom are one, the difference in the numbers of group-probability parameters. A chi-square reference gives a p-value of about 0.0086. But the alternative fits a probability of zero in group A, at the boundary of the probability range; a finite logistic coefficient for that group contrast does not exist. The small group sizes and boundary fit both call for caution about interpreting the nominal chi-square p-value as a reliable tail probability.

What a Small-Sample P-Value Says

A p-value is a tail probability computed under a specified null model and a specified reference distribution. With a chi-square calibration, it is the probability, under that chi-square distribution, of a statistic at least as large as the observed statistic. It is not the probability that the null hypothesis is true, nor does it express the probability that the observed data are “due to chance.”

In a sparse GLM, the chi-square p-value should be understood as an asymptotic approximation whose accuracy needs assessment. A small value does not repair a poor approximation, and a large value does not establish that the null model is correct. If calibration is questionable, useful checks include examining observed and fitted counts, identifying groups with fitted probabilities near zero or one, and comparing with an appropriate exact or null parametric simulation calculation where feasible. Such checks assess the reference distribution; they do not change the observed deviance statistic itself.

1
Inspect the information in the data.
Look for small expected counts, many zeros, tiny groups, or fitted probabilities close to zero or one.
2
Check the regularity behind the reference distribution.
Ask whether the null is interior, the model is identifiable, and the data provide substantial information for every tested parameter.
3
Qualify the p-value.
If sparse structure or boundary fitting makes the approximation doubtful, report the chi-square result as approximate and consider a suitable calibration check.

Common Mistake

A common mistake is to treat a chi-square p-value as exact because the software reports a numerical value with several decimal places. For example, seeing \(p=0.0086\) in the two-group example does not mean that the null probability of a result this extreme is known to four decimal places. The displayed precision belongs to the calculation under the chosen chi-square reference distribution; it does not measure the accuracy of that approximation. The correction is to distinguish the computed statistic from its calibration, inspect the sparsity and fitted values, and describe the resulting p-value as approximate when regularity is doubtful.

Key takeaway: A deviance difference can be computed correctly while its chi-square p-value is poorly calibrated. Small expected counts, extreme fitted probabilities, and boundary estimates are prompts to assess the approximation—not automatic proof that it fails, and not a universal numerical cutoff.

Check Your Understanding

Answer each question by distinguishing the deviance statistic from the distribution used to calibrate it.

  1. Why does a small expected count make a quadratic approximation to a Poisson deviance contribution less dependable?
  2. In the binomial example, why does the exact likelihood-ratio tail include outcomes 0, 1, 9, and 10?
  3. What is the difference between a reported chi-square p-value and an exact null tail probability?
  4. Why does a fitted event probability of zero in one group raise a regularity concern for a logistic-model deviance test?
  5. Does an expected count below five prove that a chi-square approximation is invalid? Explain.
Clinical Biostats