Tutorials › Generalized Linear Models › Nested Quasi-GLMs and F Tests

Quasi-Binomial and Quasi-Poisson · Tutorial 706 of 981

Nested Quasi-GLMs and F Tests

Use nested-model deviance differences to assess whether added predictors improve a quasi-GLM, while accounting for overdispersion and the approximation behind the F reference distribution.

Intermediate 11 min read

What You'll Learn

  • Define the reduced and full quasi-GLMs in a nested comparison
  • Calculate the deviance reduction and the number of added parameters
  • Construct an approximate F statistic using a dispersion estimate
  • Select the denominator degrees of freedom from the full model
  • Interpret the test without treating it as an exact likelihood-ratio test
  • Recognize when differences in data, offsets, or dispersion estimates invalidate a comparison

Why Compare Nested Quasi-GLMs?

A model with additional predictors can usually fit the observed responses at least as closely as a simpler model. The practical question is whether the improvement is large relative to the residual variation. In a quasi-binomial or quasi-Poisson model, that comparison must account for dispersion: variability may exceed what the corresponding binomial or Poisson variance function alone describes.

A nested-model F test summarizes the improvement with three quantities: the reduction in deviance, the number of added parameters, and an estimate of the dispersion. It gives an approximate test of whether the added terms are needed. It is not an exact likelihood-ratio test: a quasi-GLM specifies a mean and variance relationship, not a full response likelihood.

Set Up the Nested Comparison

Definition: A reduced model is nested within a full model if every mean structure allowed by the reduced model is also allowed by the full model. The null hypothesis states that the additional terms in the full model have no effect. If the full model adds \(q\) independent parameters, the null imposes \(q\) restrictions.

For the comparison to be interpretable, fit both models to the same response observations, using the same response definition, variance function, weights, and offset. The models must differ only in their mean-model terms. Let \(D_R\) and \(D_F\) be their unscaled deviances, and let \(p_R\) and \(p_F\) be the ranks of their fitted design matrices. Then

$$ \Delta D = D_R-D_F,\qquad q=p_F-p_R. $$

The full model’s residual degrees of freedom are typically \(\nu=n-p_F\), where \(n\) is the number of independent observational units and \(p_F\) is the rank of its design matrix. For grouped binomial data, an observational unit is a group, not an individual trial. The degrees of freedom count independent rows of the fitted model, not the total number of trials.

When the models are fitted by maximizing the same quasi-likelihood criterion, the full model’s larger parameter space cannot produce a worse optimum. Equivalently, when the corresponding deviance is minimized, \(D_F\leq D_R\), so \(\Delta D\geq 0\). The comparison is based on this improvement, not on either deviance in isolation.

Worked Example: Counting the Added Parameters

A quasi-Poisson model for counts includes an intercept, age, and treatment. A proposed full model adds the interaction between age and treatment. Suppose the interaction contributes one independent coefficient, and the design matrix ranks are 3 for the reduced model and 4 for the full model.

The models are nested because setting the interaction coefficient to zero gives the reduced mean structure. The test is \(H_0:\beta_{\text{interaction}}=0\) against the alternative that this coefficient is not zero. The parameter difference is \(q=4-3=1\). If there are \(n=50\) independent observational units, the full model has \(\nu=50-4=46\) residual degrees of freedom. The deviance reduction and dispersion estimate are still needed to calculate the test statistic.

From Deviance Reduction to an Approximate F Statistic

Under the null hypothesis, the extra terms should improve the fit only by an amount consistent with random variation. In a quasi-GLM, the dispersion parameter \(\phi\) scales the variance: for example, the quasi-Poisson variance is \(\phi\mu_i\), while the quasi-binomial variance for a proportion has the corresponding binomial variance multiplied by \(\phi\). A larger \(\phi\) means that a given deviance reduction is less surprising.

Approximate F test: Let \(\hat{\phi}\) be a dispersion estimate, conventionally obtained from the full model. For nested models differing by \(q=p_F-p_R\) parameters, use
$$ F_{\mathrm{obs}}=\frac{(D_R-D_F)/q}{\hat{\phi}}, \qquad F_{\mathrm{obs}}\ \text{is compared approximately with } F_{q,\nu}, \qquad \nu=n-p_F. $$

The numerator is the reduction in deviance per added parameter. Dividing by \(\hat{\phi}\) puts that reduction on the scale of residual variation. A small upper-tail probability under the approximate \(F_{q,\nu}\) reference distribution is evidence against the reduced model. The reference distribution is approximate, not exact: in particular, replacing an unknown dispersion by an estimate does not in general produce an exact finite-sample F distribution.

Why This Has an F Reference Distribution

The first step in the justification is an asymptotic one. Under regularity conditions—independent observations, a correctly specified mean and variance relationship, an interior null parameter, full-rank model matrices, and a fixed number \(q\) of added terms—the improvement in quasi-likelihood is locally quadratic. The quasi-score for the added terms, after accounting for the nuisance parameters in the reduced model, is approximately normal with covariance equal to \(\phi\) times its information matrix.

Result: Under these conditions and under the null hypothesis, the unscaled deviance reduction satisfies \(\Delta D/\phi\approx\chi^2_q\) in large samples.

To see the quadratic form behind this approximation, write \(U\) for the efficient quasi-score for the \(q\) added parameters and \(I\) for its information matrix. A second-order expansion of the quasi-likelihood around the reduced fit gives the increase in twice the quasi-log-likelihood as approximately \(U^{\mathsf T}I^{-1}U\). Under the null, \(U\) is approximately \(N(0,\phi I)\). Thus \(I^{-1/2}U/\sqrt{\phi}\) is approximately a \(q\)-dimensional standard normal vector, and

$$ \frac{U^{\mathsf T}I^{-1}U}{\phi} = \left(\frac{I^{-1/2}U}{\sqrt{\phi}}\right)^{\mathsf T} \left(\frac{I^{-1/2}U}{\sqrt{\phi}}\right) \approx \chi^2_q. $$

The deviance reduction is the corresponding quasi-likelihood improvement to this order, which gives \(\Delta D/\phi\approx\chi^2_q\). This is an asymptotic quadratic approximation, not an appeal to a likelihood-ratio theorem for a quasi-model.

A second approximation supplies the denominator. If the full-model residual variation is estimated by a Pearson statistic, then under a suitable large-sample approximation the Pearson statistic divided by \(\phi\) behaves roughly like \(\chi^2_\nu\). Consequently, \(\hat{\phi}=X^2_F/\nu\) acts like an estimate based on that residual variation. If the numerator and the dispersion estimate are treated as approximately independent, their ratio has the reference form

$$ \frac{\chi^2_q/q}{\chi^2_\nu/\nu}\sim F_{q,\nu}. $$

In practice, the independence and chi-square approximations are not exact for general quasi-GLMs. They explain why an F reference distribution is useful, but also why the test should be reported as approximate. Estimating dispersion from the full-model deviance instead of its Pearson statistic is another common convention; whichever estimate is used should be stated.

Worked Example: Quasi-Poisson Comparison With Pearson Dispersion

Suppose a reduced quasi-Poisson model has deviance 48.6 and a full model has deviance 40.2. The full model has 7 parameters, the reduced model has 4, and there are 60 independent count observations. The full-model Pearson statistic is 84.8.

Deviance reduction and numerator degrees of freedom. The added terms contribute \(q=7-4=3\) parameters, and \(\Delta D=48.6-40.2=8.4\). Therefore the reduction per added parameter is \(8.4/3=2.8\).

Dispersion and denominator degrees of freedom. The full-model residual degrees of freedom are \(\nu=60-7=53\). The Pearson dispersion estimate is \(\hat{\phi}=84.8/53=1.60\) to two decimal places.

Test statistic. Substituting gives \(F_{\mathrm{obs}}=2.8/1.60=1.75\), compared approximately with \(F_{3,53}\). The 5% upper-tail critical value is about 2.78, so 1.75 does not exceed it. At the 5% level, this comparison does not provide sufficient evidence to reject the reduced model.

Worked Example: Quasi-Binomial Comparison With Grouped Trials

A study records the numbers of successes and trials in 36 groups. A reduced quasi-binomial model has rank 3 and deviance 31.4; a full model adds three independent predictor terms, has rank 6, and deviance 18.8. The full-model Pearson statistic is 63.0.

The deviance reduction is \(31.4-18.8=12.6\), and the numerator degrees of freedom are \(q=6-3=3\). There are 36 observational units, so the full-model residual degrees of freedom are \(\nu=36-6=30\). The dispersion estimate is \(\hat{\phi}=63.0/30=2.1\).

The test statistic is \(F_{\mathrm{obs}}=(12.6/3)/2.1=4.2/2.1=2.0\), compared with \(F_{3,30}\). The approximate 5% upper-tail critical value is about 2.92. Since \(2.0<2.92\), the test does not reject the reduced model at the 5% level. The 36 groups, rather than the total number of trials across those groups, determine the residual degrees of freedom.

Worked Example: A Larger Reduction After Accounting for Dispersion

Suppose two nested quasi-Poisson models are fitted to 80 independent observations. The reduced model has rank 5 and deviance 52; the full model has rank 7 and deviance 34. Its Pearson statistic is 109.5.

Here \(\Delta D=52-34=18\), \(q=7-5=2\), and \(\nu=80-7=73\). The Pearson dispersion estimate is \(109.5/73=1.5\). The resulting statistic is \(F_{\mathrm{obs}}=(18/2)/1.5=9/1.5=6\), compared with \(F_{2,73}\). The 5% critical value is about 3.12, so \(6>3.12\): the test rejects the reduced model at the 5% level. This conclusion is based on the approximate reference distribution and the stated dispersion estimate.

Practical Checks and a Common Pitfall

Before interpreting the result, verify that both fits use the same observations and response setup, that the full model really contains the reduced model, and that \(q\) is the difference in model-matrix ranks. Redundant columns do not add independent parameters, even if they appear as extra terms in a formula. Also report which dispersion estimate was used: changing \(\hat{\phi}\) changes the F statistic.

A common mistake is to calculate \((D_R-D_F)/q\) and compare it directly with a chi-square or F cutoff, ignoring dispersion. For example, in the grouped-trial calculation above, the reduction per added parameter is 4.2, but the test statistic is \(4.2/2.1=2.0\). Treating 4.2 as the F statistic would overstate the evidence because it fails to account for the estimated overdispersion.

  • Do not call this an exact likelihood-ratio test. A quasi-model does not specify a full likelihood for the response.
  • Do not compare non-nested models with this formula. A deviance difference has the stated interpretation only when the model spaces are nested.
  • Do not mix dispersion estimates without saying so. State whether the estimate comes from Pearson residuals, deviance, or another specified source.
  • Do not use the total number of binomial trials as the number of independent rows. For grouped data, use the number of groups when calculating the usual residual degrees of freedom.
Key takeaway: For nested quasi-GLMs, divide the deviance reduction by the number of added independent parameters and by an explicitly chosen dispersion estimate. Compare the resulting statistic with an approximate \(F_{q,n-p_F}\) distribution, and interpret the test with the assumptions and approximation in view.

Check Your Understanding

For each question, identify the quantities that determine the approximate nested-model test.

  1. A full model adds two independent terms to a reduced model. What is the numerator degrees of freedom, and how is the deviance reduction defined?
  2. Why is the usual comparison not an exact likelihood-ratio test for a quasi-Poisson model?
  3. A grouped binomial data set contains 24 groups with a total of 800 trials. Which count is ordinarily used as \(n\) when calculating residual degrees of freedom, and why?
  4. If the deviance reduction stays fixed while the dispersion estimate increases, what happens to the approximate F statistic?
  5. Name two checks to make before interpreting a nested quasi-GLM F test.
Clinical Biostats