Why Standardize Residuals by Their Variance?
A raw residual \(Y_i-\hat{\mu}_i\) measures the difference between an observed response and its fitted mean. But a difference of 2 can be substantial when the model predicts variance 1 and quite ordinary when it predicts variance 100. For binomial and Poisson GLMs, the mean itself determines the model-based variance, so residuals should be scaled by that variance before their sizes are compared.
The Pearson chi-square statistic collects the squared, variance-standardized residuals. Its basic question is: are the observed departures from the fitted means large relative to the variation the model says to expect? A large value is evidence of a discrepancy, but does not by itself identify its cause.
The denominator is the standard deviation implied by the fitted response family at the fitted mean. For a binomial response \(Y_i\sim\operatorname{Binomial}(n_i,p_i)\), the mean is \(n_i p_i\) and the variance is \(n_i p_i(1-p_i)\). For a Poisson response, the mean and variance are both \(\mu_i\). These are the conditional variance benchmarks for the two families.
Deriving the Binomial and Poisson Forms
Write \(\hat{p}_i\) for the fitted binomial success probability and \(\hat{\mu}_i\) for the fitted Poisson mean. Substituting each family’s variance into the definition gives the specific residuals and statistics. For binomial data, \(n_i\) is the number of trials represented by observation \(i\); it is not the number of response rows.
The derivation is direct but important: standardization uses the variance of the response, not the variance of its mean estimate. For a binomial observation, the fitted mean is \(n_i\hat{p}_i\), so its fitted variance is \(n_i\hat{p}_i(1-\hat{p}_i)\). For a Poisson observation, both the fitted mean and fitted variance are \(\hat{\mu}_i\). Thus the individual contributions are
Worked Example: Pearson Contributions for Poisson Counts
Suppose four independent Poisson responses have observed counts \(0,2,4,6\), and a fitted model gives means \(1,2,3,4\), respectively. Calculate each Pearson residual and the total statistic.
For the first response, \(r_{P1}=(0-1)/\sqrt{1}=-1\), so \(r_{P1}^2=1\). For the second, \(r_{P2}=(2-2)/\sqrt{2}=0\), giving \(r_{P2}^2=0\).
For the third, \(r_{P3}=(4-3)/\sqrt{3}=1/\sqrt{3}\), so \(r_{P3}^2=1/3\). For the fourth, \(r_{P4}=(6-4)/\sqrt{4}=1\), so \(r_{P4}^2=1\).
Therefore \(X_P^2=1+0+1/3+1=7/3\approx2.33\). The fourth observation’s raw residual is 2, but its squared Pearson contribution is only 1 because a Poisson mean of 4 also implies variance 4. Each contribution is judged relative to the fitted variation at that observation.
Worked Example: Grouped Binomial Responses
Consider three groups with trial counts \(n_i=10,20,15\), fitted probabilities \(\hat{p}_i=0.2,0.3,0.4\), and observed success counts \(Y_i=4,8,9\). Calculate the Pearson statistic.
For group 1, the fitted mean is \(10(0.2)=2\), the fitted variance is \(10(0.2)(0.8)=1.6\), and the residual is \((4-2)/\sqrt{1.6}\approx1.581\). Its contribution is \(2^2/1.6=2.5\).
For group 2, the fitted mean is \(20(0.3)=6\) and the fitted variance is \(20(0.3)(0.7)=4.2\). Its residual is \((8-6)/\sqrt{4.2}\approx0.976\), and its contribution is \(2^2/4.2\approx0.9524\).
For group 3, the fitted mean is \(15(0.4)=6\) and the fitted variance is \(15(0.4)(0.6)=3.6\). Its residual is \((9-6)/\sqrt{3.6}\approx1.581\), and its contribution is \(3^2/3.6=2.5\).
Adding the contributions gives \(X_P^2=2.5+0.9524+2.5\approx5.9524\). The calculation uses the number of trials in each group in both the mean and variance; using only the fitted probability in the denominator would not give the binomial Pearson statistic.
What the Size of the Statistic Measures
The interpretation rests on a simple expectation calculation. First suppose the means \(\mu_i\) and benchmark variances \(V_i>0\) are fixed, and observations have finite second moments. For one observation, the expected squared standardized departure has two parts: a variance term and a squared mean-error term. This identifies why a large Pearson contribution can arise from more than extra variance.
To verify the result, add and subtract \(E[Y_i]\) inside the squared difference:
The middle term is zero because \(E[Y_i-E[Y_i]]=0\). Dividing by \(V_i>0\) proves the identity. When the mean is correct and the actual variance is \(\phi_i V_i\), the expected contribution is \(\phi_i\). Consequently, if all \(m\) observations have the same variance multiplier \(\phi\), and their means are correct, the expected sum with fixed means and variances is \(m\phi\). Under the binomial or Poisson benchmark, \(\phi=1\), so the expected sum is \(m\) in this fixed-parameter calculation.
That calculation explains the diagnostic’s logic: contributions tend to be larger when the data vary more than the benchmark allows. It is not, however, an exact expectation formula for residuals formed using parameters estimated from the same responses. Fitted means depend on the data, so the fixed-mean argument cannot simply be applied to them as if they were known in advance. The statistic remains a useful diagnostic, but its sampling behavior after fitting requires care.
Worked Example: Extra Variance and a Mean Error Have Different Effects
Suppose a Poisson model gives a fixed mean \(\mu=2\), and its benchmark variance is \(V=2\). Under the model, \(\operatorname{Var}(Y)=2\) and \(E[Y]=2\), so the expected squared Pearson residual is \(2/2=1\).
Now suppose instead the actual response has mean 2 but variance 6. Its mean is still correct, but its variance is three times the Poisson benchmark. The expected contribution becomes \(6/2=3\). This is the variance-inflation signal the statistic is designed to reveal.
Alternatively, suppose the actual response is Poisson with mean 5, while the model still uses \(\mu=2\) and \(V=2\). The actual variance is 5, but the mean is also wrong. The expected contribution is \((5+(5-2)^2)/2=(5+9)/2=7\).
The value 7 is larger than 1, but the identity shows why it cannot be interpreted as a pure variance effect: 5 comes from the actual variance and 9 from the squared mean discrepancy. A large statistic signals disagreement with the fitted benchmark; additional checks are needed to understand that disagreement.
Using the Diagnostic Carefully
For a fitted GLM, compute the fitted mean for each response, evaluate the family’s variance function at that mean, and sum the squared standardized residuals. A large \(X_P^2\) means the residual departures are collectively large relative to those model-based variances. It is a prompt to investigate, not a standalone explanation or automatic verdict.
In particular, a large value can reflect genuine extra variation, but it can also arise when the mean structure is not adequate. The expectation identity makes this distinction precise: a mean error adds a nonnegative squared-bias term to the expected contribution. The statistic alone does not separate these sources. Nor should its name be taken to establish that it follows an exact chi-square distribution in a fitted model; estimation and the data structure matter for calibration.
A small value is not proof that the model is correct either. The observed residuals may happen to be modest, and a sum of squares compresses their pattern into one number. It is useful to inspect the individual residuals and the context of the observations as well. For the binomial formula, fitted probabilities at 0 or 1 give zero fitted variance, so the ordinary Pearson residual is undefined there; the stated formula applies when \(0<\hat{p}_i<1\). For Poisson responses, it requires \(\hat{\mu}_i>0\).
Check Your Understanding
Use the definitions and calculations above to answer these questions.
- For a Poisson observation with \(Y=7\) and fitted mean \(\hat{\mu}=4\), calculate the Pearson residual and its squared contribution.
- A binomial group has \(n=12\), fitted probability \(0.25\), and observed success count \(5\). What fitted variance belongs in its Pearson contribution?
- Why does a raw residual of 2 have different significance under Poisson fitted means of 1 and 100?
- State the two terms in the expected squared standardized departure when the model benchmark mean may be incorrect.
- Why does a large Pearson statistic not establish that extra variance, rather than mean misspecification, is present?