Why Estimate Dispersion From Residuals?
A quasi-binomial or quasi-Poisson model specifies a mean structure and a variance function, but it also allows a scale parameter to multiply that variance. The scale matters: it describes how variable observations are relative to the variance function, and it is estimated from the residual variation left after fitting the mean. Pearson residuals provide a direct way to summarize that variation.
The key adjustment is for the parameters already used to fit the mean. A raw sum of squared residuals tends to be smaller than the sum one would calculate using the true means. Dividing the Pearson sum by the residual degrees of freedom, rather than by the number of observations, accounts approximately for this loss of variation.
Here \(V(\mu_i)\) is the variance function without the scale factor: the quasi-model specifies \(\operatorname{Var}(Y_i)=\phi V(\mu_i)\). Thus the Pearson residual as defined above does not divide by \(\sqrt{\phi}\). The scale is what the sum of squared Pearson residuals is intended to estimate after adjusting for fitted parameters. This definition assumes independent observations without additional observation weights; the response scale used in \(V\) must match the response scale used in the residual.
Why the Residual Degrees of Freedom Appear
The adjustment can be understood by looking first at a linear approximation to the fitted means. Write \(D\) for the \(n\)-by-\(q\) matrix whose \(i\)th row is the derivative of \(\mu_i\) with respect to the mean-model parameter vector. Let \(V\) be the diagonal matrix with entries \(V(\mu_i)\). For a small parameter change, the change in the vector of means is approximately \(D\) times that change. The quasi-score equations then project the response residuals onto the fitted mean directions.
Here is the derivation, including the distinction between the linearized result and the statistic calculated from fitted values. Let \(e_i=(Y_i-\mu_i)/\sqrt{V(\mu_i)}\), and collect these into \(e\). Independence gives \(E[e]=0\) and \(\operatorname{Cov}(e)=\phi I\). Define \(G=V^{-1/2}D\), where \(V^{-1/2}\) is diagonal. The first-order change in the standardized fitted means lies in the column space of \(G\). The quasi-score linearization therefore removes the projection \(He\), where \(H=G(G^\mathsf{T}G)^{-1}G^\mathsf{T}\) when \(G\) has full column rank. If only \(q\) independent mean directions are estimable, use the corresponding rank-\(q\) projection. The linearized residual vector is \(Ae=(I-H)e\).
The last equality follows because \(H\) is a rank-\(q\) projection, so \(A=I-H\) is also a projection, with rank and trace \(n-q\). This proves the expectation statement for the linearized statistic. It is not a claim that the Pearson sum calculated from a nonlinear fitted GLM has exactly this expectation in every finite sample.
For the consistency statement, set \(u=e/\sqrt{\phi}\), so that the components of \(u\) are independent, have mean zero and variance one, and have bounded fourth moments. The linearized sum is \(\phi u^\mathsf{T}Au\). Since \(A\) is a projection, \(A^2=A\), and its rank is \(n-q\). The variance of a quadratic form in independent errors with bounded fourth moments is bounded by a constant times \(\operatorname{tr}(A^2)+\sum_i A_{ii}^2\). Both terms are at most \(n\), so this variance is \(O(n)\). Chebyshev's inequality then gives \((u^\mathsf{T}Au)/(n-q)\xrightarrow{p}1\) for fixed \(q\). The stated fitting-approximation condition transfers this result to \(X_P^2\), proving consistency of the Pearson scale estimate. \(\square\)
In practice, the design matrix and the means are estimated, and Pearson residuals use \(V(\hat\mu_i)\), not the unknown \(V(\mu_i)\). The theorem explains the first-order adjustment; it does not make the finite-sample estimate exactly unbiased. Standard regularity conditions for a well-behaved quasi-GLM fit—such as a smooth mean model, identifiable parameters, and a consistent estimator—are important to the approximation.
Calculating the Estimate in Quasi-GLMs
The variance function determines the denominator of each Pearson residual. For grouped binomial counts \(Y_i\) out of \(m_i\) trials, with success probability \(\pi_i\), the variance function is \(V(\mu_i)=m_i\pi_i(1-\pi_i)\), where \(\mu_i=m_i\pi_i\). For a quasi-Poisson count, \(V(\mu_i)=\mu_i\). In both cases, the quasi-model variance is \(\phi V(\mu_i)\); do not insert \(\phi\) into the Pearson residual denominator when calculating \(\hat\phi_P\).
Worked Example: Quasi-Binomial Counts With Equal Trial Totals
Four groups each have 10 trials, with observed success counts 2, 4, 6, and 8. Fit an intercept-only quasi-binomial model and calculate the Pearson dispersion estimate.
With an intercept only, the fitted probability is the pooled success proportion: \(\hat\pi=(2+4+6+8)/(4\cdot10)=20/40=0.5\). Thus each fitted count is \(\hat\mu_i=10(0.5)=5\), and each variance-function value is \(V(\hat\mu_i)=10(0.5)(0.5)=2.5\).
The four squared Pearson residuals are \((2-5)^2/2.5=3.6\), \((4-5)^2/2.5=0.4\), \((6-5)^2/2.5=0.4\), and \((8-5)^2/2.5=3.6\). Therefore \(X_P^2=3.6+0.4+0.4+3.6=8\). There are \(n=4\) observations and \(q=1\) fitted mean parameter, so the residual degrees of freedom are \(4-1=3\). The estimate is \(\hat\phi_P=8/3\approx2.67\).
This estimate indicates that the residual variation is about 2.67 times the binomial variance function, on this scale. The grouped counts are more variable than the quasi-binomial model with \(\phi=1\) would suggest, though the estimate from just four groups is imprecise.
Worked Example: Quasi-Poisson Counts and an Intercept-Only Fit
Suppose six independent counts are \(0,0,3,3,6,6\). Fit a quasi-Poisson model with an intercept only and calculate the Pearson estimate.
The intercept-only fitted mean is the sample mean: \(\hat\mu=(0+0+3+3+6+6)/6=18/6=3\). For quasi-Poisson, \(V(\hat\mu_i)=\hat\mu_i=3\) for every observation. The squared Pearson residuals are \((0-3)^2/3=3\), \(3\), \(0\), \(0\), \(3\), and \(3\). Hence \(X_P^2=12\).
There are \(n=6\) observations and \(q=1\) fitted parameter, giving \(n-q=5\) residual degrees of freedom. Thus \(\hat\phi_P=12/5=2.4\). The observed residual variation is 2.4 times the Poisson variance function at the fitted means, which is evidence of overdispersion relative to a Poisson model. This calculation estimates a scale; it does not by itself identify the cause of the extra variation.
Worked Example: Unequal Trial Totals in a Quasi-Binomial Fit
Three groups have respectively 5, 10, and 20 trials, with success counts 2, 8, and 15. Fit an intercept-only quasi-binomial model and calculate the Pearson scale estimate.
There are 25 successes among 35 trials, so \(\hat\pi=25/35=5/7\). The fitted counts are \(25/7\), \(50/7\), and \(100/7\). Their variance-function values are, respectively, \(5(5/7)(2/7)=50/49\), \(10(5/7)(2/7)=100/49\), and \(20(5/7)(2/7)=200/49\).
The squared Pearson residuals are \((2-25/7)^2/(50/49)=(121/49)/(50/49)=121/50=2.42\), \((8-50/7)^2/(100/49)=(36/49)/(100/49)=0.36\), and \((15-100/7)^2/(200/49)=(25/49)/(200/49)=0.125\). So \(X_P^2=2.42+0.36+0.125=2.905\). With three observations and one fitted parameter, \(n-q=2\), and \(\hat\phi_P=2.905/2=1.4525\).
The estimate is above one, suggesting residual variation greater than the binomial variance function in this fit. Unequal trial totals affect the calculation through each group’s own variance-function value; treating the three proportions as if they had equal precision would give a different and inappropriate Pearson statistic.
Interpretation and Common Mistakes
The Pearson estimate is a residual-based estimate of a variance multiplier, not a replacement for checking the mean structure. A missing predictor, an incorrect link or mean relationship, dependence among observations, or unusual observations can all contribute to a large Pearson statistic. The statistic alone cannot distinguish these explanations. Similarly, an estimate below one is possible: it indicates less residual variation than the reference variance function suggests, rather than being an arithmetic error.
- Using \(n\) in the denominator. The mean parameters were estimated from the same observations, so the usual Pearson scale estimate divides by residual degrees of freedom \(n-q\), not \(n\).
- Including the scale in the residual denominator. If the goal is to estimate \(\phi\), calculate \(X_P^2\) using \(V(\hat\mu_i)\) alone. Dividing each residual by \(\sqrt{\hat\phi V(\hat\mu_i)}\) first would scale away the quantity being estimated.
- Using the wrong response scale. For grouped binomial data, use the variance for the count if the response is a count, or the corresponding variance for the proportion if the response is a proportion. Do not mix the two.
- Calling the result an exact chi-square test. The degrees-of-freedom adjustment comes from a projection approximation. A fitted GLM’s Pearson statistic is not generally an exact chi-square random variable, and the estimate is not, by itself, a formal test of overdispersion.
The practical value of \(\hat\phi_P\) is that it turns the residual sum into an interpretable scale estimate while accounting approximately for fitted mean parameters. It is useful to report alongside the model’s variance assumption and a check that the mean model is plausible. Its interpretation remains conditional on those modeling choices.
Check Your Understanding
Answer each question using the variance function and degrees of freedom appropriate to the stated fit.
- For independent quasi-Poisson counts, what quantity belongs in the denominator of a Pearson residual?
- A model has \(n=18\) observations and 4 estimable mean parameters. What residual degrees of freedom are used in the Pearson scale estimate?
- Why does fitting the mean reduce the expected first-order Pearson sum from approximately \(n\phi\) to approximately \((n-q)\phi\)?
- For grouped binomial counts with unequal trial totals, why should each group have its own variance-function value?
- Does \(\hat\phi_P>1\) establish that the mean model is correctly specified? Explain briefly.