Why Exposure and Weights Matter in GLM Diagnostics
A count of five events has a different interpretation when it arose over one day than when it arose over a year. Likewise, a binomial group with 100 trials usually carries more information about its success probability than a group with 10 trials. In generalized linear models (GLMs), exposure offsets and weights encode these distinctions, affecting fitted means as well as diagnostic quantities.
The key is not to treat exposure and weight as interchangeable. An exposure offset changes the mean according to a known amount of time or risk. A prior weight multiplies an observation's contribution to fitting under the weighting convention being used. Both can affect leverage and influence, but they do so through different parts of the model. This topic is aligned with the SOA Exam SRM (Statistics for Risk Modeling) syllabus.
Offsets, Fitted Means, and Poisson Residuals
For a Poisson model with log link and known exposure, the fitted mean is \(\widehat{\mu}_i=E_i\exp(x_i^\mathsf{T}\widehat{\beta})\). The offset therefore scales the expected count, while the regression coefficients describe how the rate varies with predictors. Exposures must use a consistent unit: if the rate is per year, an exposure of six months is \(0.5\) years, not \(6\).
For an intercept-only rate model, let \(\lambda=\exp(\beta_0)\), so that \(\mu_i=E_i\lambda\). If the total observed count is positive, maximizing the Poisson likelihood gives \(\widehat{\lambda}=\sum_i y_i/\sum_i E_i\). To see why, the part of the log likelihood depending on \(\lambda\) is \(\ell(\lambda)=\sum_i[y_i\log(E_i\lambda)-E_i\lambda-\log(y_i!)]\). Its derivative is \(\ell'(\lambda)=\sum_i y_i/\lambda-\sum_i E_i\). Setting this equal to zero yields the estimate. If every count is zero, there is no positive solution to this score equation: the maximum is at the boundary \(\lambda=0\), if that boundary is allowed, or the likelihood approaches its supremum as \(\lambda\downarrow0\) under a strict log-link parameterization.
For a Poisson observation with mean \(\mu_i\), the Pearson residual is \(r_{P,i}=(y_i-\widehat{\mu}_i)/\sqrt{\widehat{\mu}_i}\) when the dispersion is one. Exposure affects this residual through the fitted mean. It does not add a separate multiplier to the residual merely because it is exposure. If a likelihood-multiplier prior weight \(w_i\) is also used, its Pearson contribution under this convention is \(\sqrt{w_i}(y_i-\widehat{\mu}_i)/\sqrt{\widehat{\mu}_i}\).
Worked Example: Fitting a Rate With Unequal Exposures
A hypothetical monitoring program records \(y_1=1\) event over \(E_1=2\) exposure units and \(y_2=5\) events over \(E_2=8\) units. Assume independent Poisson counts with a common rate per exposure unit and a log link with \(\log(E_i)\) as an offset. Find the fitted means, Pearson residuals, and leverages.
Method and rate estimate. The total count is \(1+5=6\), and total exposure is \(2+8=10\). Thus \(\widehat{\lambda}=6/10=0.6\). The fitted means are \(\widehat{\mu}_1=2(0.6)=1.2\) and \(\widehat{\mu}_2=8(0.6)=4.8\). As a check, the fitted counts sum to \(1.2+4.8=6\), matching the observed total.
Pearson residuals. For the first site, \(r_{P,1}=(1-1.2)/\sqrt{1.2}=-0.2/1.0954\approx-0.1826\). For the second, \(r_{P,2}=(5-4.8)/\sqrt{4.8}=0.2/2.1909\approx0.0913\). Their score contributions sum to zero because \((1-1.2)+(5-4.8)=0\), as expected for the fitted intercept-only rate.
Leverages. With one fitted intercept and a Poisson log link, the converged working weights are the fitted means. In this intercept-only model, the leverage at site \(i\) is therefore \(h_i=\widehat{\mu}_i/\sum_j\widehat{\mu}_j\). Thus \(h_1=1.2/6=0.2000\) and \(h_2=4.8/6=0.8000\). The approximate standardized Pearson residuals \(r_{P,i}/\sqrt{1-h_i}\) are \(-0.1826/\sqrt{0.8}\approx-0.2041\) and \(0.0913/\sqrt{0.2}\approx0.2041\).
Influence check and mistake avoided. Deleting site 1 gives a rate estimate \(5/8=0.625\), a change of \(+0.025\) from \(0.6\). Deleting site 2 gives \(1/2=0.5\), a change of \(-0.1\). The high-exposure site has higher leverage and its deletion changes the rate more. A common mistake is to use one common fitted mean for both sites, ignoring the offset; the model instead gives means proportional to exposures.
Prior Weights and GLM Leverage
At a converged GLM fit, the iteratively reweighted least-squares (IRLS) approximation uses a weighted least-squares problem. For a model with mean \(\mu_i\), variance function \(V(\mu_i)\), link \(g\), and dispersion \(\phi\), the working weight before any prior weight is \((d\mu_i/d\eta_i)^2/[\phi V(\mu_i)]\), where \(\eta_i=g(\mu_i)\). Under the frequency-weight convention, the full IRLS weight is \(\widetilde{w}_i=w_i(d\mu_i/d\eta_i)^2/[\phi V(\mu_i)]\). For a Poisson log-link model with \(\phi=1\), \(V(\mu_i)=\mu_i\) and \(d\mu_i/d\eta_i=\mu_i\); hence \(\widetilde{w}_i=w_i\mu_i\). An exposure offset affects \(\mu_i\), while a prior weight multiplies the resulting IRLS weight.
Let \(X\) be the model matrix and let \(W\) be the diagonal matrix of converged IRLS weights. The weighted hat matrix is \(H=W^{1/2}X(X^\mathsf{T}WX)^{-1}X^\mathsf{T}W^{1/2}\), and leverage \(h_i\) is its \(i\)th diagonal element. This formula assumes the fitted model matrix has full column rank. One justification is to transform the local weighted least-squares problem by multiplying each row of the design matrix and working response by \(\sqrt{\widetilde{w}_i}\). The ordinary least-squares projection matrix for those transformed quantities is exactly \(H\). Thus observations with greater working weight can exert greater leverage, although their precise leverage also depends on their predictor values and the other observations.
For grouped binomial data, group \(i\) has \(y_i\) successes among \(n_i\) trials, with estimated probability \(\widehat p_i\). Under a logistic link, its IRLS weight is \(n_i\widehat p_i(1-\widehat p_i)\). The trial count is already part of the grouped-binomial likelihood and variance. Do not multiply by \(n_i\) a second time as an extra prior weight. The Pearson residual for the observed success count is \((y_i-n_i\widehat p_i)/\sqrt{n_i\widehat p_i(1-\widehat p_i)}\). For a general prior likelihood multiplier \(w_i\), this contribution is multiplied by \(\sqrt{w_i}\), if that is the intended weighting convention.
Worked Example: Trial Counts Affect Grouped-Binomial Diagnostics
A hypothetical two-group study records 3 successes among 10 trials in group A and 18 successes among 30 trials in group B. Fit an intercept-only binomial model, then calculate fitted success counts, Pearson residuals, and leverages.
Method and fitted probability. The pooled estimate is \(\widehat p=(3+18)/(10+30)=21/40=0.525\). The fitted success counts are \(10(0.525)=5.25\) and \(30(0.525)=15.75\), which sum to the observed 21 successes.
Pearson residuals. For group A, the residual numerator is \(3-5.25=-2.25\). Its variance estimate is \(10(0.525)(0.475)=2.49375\), so the residual is \(-2.25/\sqrt{2.49375}\approx-1.4248\). For group B, the numerator is \(18-15.75=2.25\), and the variance estimate is \(30(0.525)(0.475)=7.48125\). Its residual is \(2.25/\sqrt{7.48125}\approx0.8227\). The opposing residuals reflect the fitted total number of successes.
Leverages and deletion check. In this intercept-only logistic model, the group weights are \(n_i\widehat p(1-\widehat p)\). The common probability factor cancels when computing the diagonal leverages, giving \(h_A=10/40=0.2500\) and \(h_B=30/40=0.7500\). Deleting group A leaves \(18/30=0.600\); deleting group B leaves \(3/10=0.300\). Each deletion removes an entire group, not one trial. The larger group has higher leverage and its removal changes the fitted probability more. The mistake to avoid is treating the two groups as equally informative just because the data table has two rows.
How Exposure and Prior Weights Differ
The distinction can be made explicit in an intercept-only Poisson model. With exposure \(E_i\), the mean is \(E_i\lambda\); the exposure changes the expected count. With a likelihood-multiplier prior weight \(w_i\) but no offset, the mean is still \(\lambda\); the weight changes how strongly that observation contributes to estimating \(\lambda\). If both are present, the mean is \(E_i\lambda\), and the likelihood contribution is multiplied by \(w_i\).
Worked Example: A Frequency Weight Is Not an Exposure Offset
Suppose two independent Poisson observations are \(y_1=1\) and \(y_2=4\), with prior frequency weights \(w_1=1\) and \(w_2=3\). There is no exposure offset, and the model has one common fitted mean. Find the estimate, weighted Pearson contributions, and leverages. Then compare with mistakenly treating the weights as exposures.
Weighted fit. The weighted log likelihood is \(\ell(\lambda)=\sum_i w_i[y_i\log(\lambda)-\lambda-\log(y_i!)]\). For a positive weighted total count, the score equation gives \(\widehat{\lambda}=(w_1y_1+w_2y_2)/(w_1+w_2)\). Substitution gives \((1(1)+3(4))/(1+3)=13/4=3.25\). Both fitted means are 3.25.
Residual contributions. The weighted Pearson contribution is \(\sqrt{w_i}(y_i-\widehat{\lambda})/\sqrt{\widehat{\lambda}}\). For observation 1 this is \((1-3.25)/\sqrt{3.25}\approx-1.2481\). For observation 2 it is \(\sqrt{3}(4-3.25)/\sqrt{3.25}\approx0.7206\). The weighted score contributions sum to \(1(1-3.25)+3(4-3.25)=-2.25+2.25=0\), checking the fitted value.
Leverage and the incorrect alternative. In this intercept-only weighted fit, \(h_i=w_i/(w_1+w_2)\), so \(h_1=0.2500\) and \(h_2=0.7500\). If the numbers 1 and 3 were instead exposure offsets, the model would have means \(\mu_1=\lambda\) and \(\mu_2=3\lambda\). Its fitted rate would be \((1+4)/(1+3)=1.25\), giving means 1.25 and 3.75, not 3.25 and 3.25. Confusing weights with exposures changes the model, the fitted means, and the interpretation of the residuals.
Reading Residuals and Influence Together
A residual measures discrepancy between an observation and its fitted mean; leverage describes how much the observation can affect the fitted coefficients in the local weighted approximation. Neither alone is a complete measure of influence. A high-leverage observation can have a small residual and therefore little observed discrepancy. A large residual at low leverage can be poorly positioned to move the fit. Case-deletion refits provide a direct check: compare coefficients or fitted means with the observation included and removed.
Weights also affect the scale of residual contributions. Under the likelihood-multiplier convention, doubling a prior weight multiplies its Pearson contribution by \(\sqrt{2}\), not by 2, while its likelihood contribution doubles. For a grouped-binomial row, increasing the number of trials changes both the uncertainty scale and the IRLS weight. For a Poisson offset, increasing exposure changes the fitted mean and therefore its residual denominator, but is not equivalent to duplicating the observation.
The usual diagnostic interpretation depends on the assumed conditional distribution, link, and weighting meaning being appropriate. A fixed exposure must be known and measured in the same units used for the rate. Prior weights must represent the intended replication or precision information; different software and applications may assign other meanings to weights, so confirm the convention before interpreting residuals. A leverage calculation from final IRLS weights is a local approximation for a GLM, not a guarantee that deleting a high-leverage case will produce a particular coefficient change.
Check Your Understanding
For each problem, use the stated model and distinguish offsets from prior weights. Round residuals and leverages to four decimal places where needed.
- A hypothetical Poisson process has counts 2 and 5 over exposures 3 and 7. Fit an intercept-only common rate with a log-exposure offset. Give the rate, fitted means, and leverages. (Answer: rate \(0.700\); means \(2.100\) and \(4.900\); leverages \(0.3000\) and \(0.7000\).)
- A grouped-binomial intercept-only fit has 4 successes in 12 trials and 14 successes in 28 trials. Find the fitted probability, the two leverages, and the Pearson residual for the first group. (Answer: \(\widehat p=0.450\); leverages \(0.3000\) and \(0.7000\); first residual \(-0.8120\).)
- Two Poisson observations \(y_1=2,y_2=6\) have frequency prior weights \(w_1=1,w_2=2\), with no offset and an intercept-only model. Find the fitted mean for each observation and their leverages. (Answer: both fitted means \(14/3\); leverages \(0.3333\) and \(0.6667\).)
- A known Poisson rate is \(0.4\) per exposure unit. Two sites have exposures 2 and 5 and observed counts 0 and 4. Calculate their fitted means and Pearson residuals. Are model coefficients being estimated from these two observations? (Answer: means \(0.8\) and \(2.0\); residuals \(-0.8944\) and \(1.4142\); no coefficients are estimated, since the rate is specified as known.)
- In an intercept-only grouped-binomial fit, group A has 6 successes in 20 trials and group B has 9 successes in 10 trials. Find the pooled fitted probability and the leverages. Then state the fitted probability after deleting group B. (Answer: pooled \(\widehat p=15/30=0.500\); leverages \(0.6667\) and \(0.3333\); deleting group B gives \(6/20=0.300\).)