Tutorials › Generalized Linear Models › Trial Counts And Influence In Grouped Binomial Models

Leverage and Influence · Tutorial 775 of 981

Trial Counts And Influence In Grouped Binomial Models

Learn how trial counts affect information, leverage, and case-deletion influence in grouped logistic regression, including the distinction between deleting a whole group and one trial.

Advanced 10 min read

What You'll Learn

  • Derive the information contribution of a grouped binomial observation
  • Relate group-level leverage to trial count and fitted probability
  • Compare grouped-row leverage with the leverage of individual Bernoulli trials
  • Obtain a one-step approximation to deleting an entire group
  • Distinguish whole-group deletion from deleting one trial

Why Trial Counts Matter

A grouped binomial observation records \(y_i\) successes among \(m_i\) trials at covariate vector \(x_i\). Two groups can have the same observed proportion but very different precision: 8 successes from 10 trials contain more information about a success probability than 80 from 100. In a regression model, trial counts therefore affect both how strongly a group helps determine the fitted coefficients and how much the fit may change when that group is removed.

The unit of deletion must also be clear. Removing a grouped observation removes all \(m_i\) trials at that covariate pattern. Removing one Bernoulli trial removes only one success or failure. These are different perturbations, even though the grouped likelihood and the likelihood from the individual trials give the same coefficient estimates.

Grouped Binomial Logistic Regression

Assume the groups are independent, their covariates are fixed, and \(Y_i\sim\operatorname{Binomial}(m_i,p_i)\). In logistic regression, \(p_i=\{1+\exp(-x_i^\mathsf{T}\beta)\}^{-1}\), where \(x_i\) includes an intercept if the model has one. Suppose the design matrix has full column rank and the fitted model has a finite maximum-likelihood estimate \(\hat\beta\). Write \(\hat p_i\) for the fitted probability and \(v_i=\hat p_i(1-\hat p_i)\).

Definition: For a grouped binomial observation, its fitted information weight is \(w_i=m_i\hat p_i(1-\hat p_i)\). Its contribution to the fitted Fisher information matrix is \(w_i x_i x_i^\mathsf{T}\). The fitted information matrix is $$ \mathcal I(\hat\beta)=\sum_{i=1}^n m_i\hat p_i(1-\hat p_i)x_i x_i^\mathsf{T}. $$

The count \(m_i\) enters linearly: holding the covariate and fitted probability fixed, doubling the trial count doubles the group's information contribution. The fitted probability matters too. A Bernoulli trial contributes most information when \(p_i=1/2\), since \(p_i(1-p_i)\leq 1/4\), and little information when the fitted probability is close to zero or one.

The score contribution of group \(i\) is \(x_i(y_i-m_i p_i)\). Thus a group's effect on the fit depends not just on its trial count or its information weight, but also on its observed deviation from the fitted number of successes.

Group Leverage and Individual-Trial Leverage

Let \(X\) have rows \(x_i^\mathsf{T}\), and let \(W\) be diagonal with entries \(w_i=m_i\hat p_i(1-\hat p_i)\). The weighted least-squares hat matrix for the grouped rows is \(H=W^{1/2}X(X^\mathsf{T}WX)^{-1}X^\mathsf{T}W^{1/2}\). Its \(i\)th diagonal entry is the grouped-row leverage.

Result: The leverage of grouped observation \(i\) is $$ h_i=m_i\hat p_i(1-\hat p_i)x_i^\mathsf{T}\mathcal I(\hat\beta)^{-1}x_i. $$ If that group is expanded into \(m_i\) Bernoulli trials with identical covariates, each individual trial has leverage \(h_i/m_i\) in the expanded-data hat matrix.

To verify the first expression, take the \(i\)th diagonal entry in the definition of \(H\). It is \(w_i x_i^\mathsf{T}(X^\mathsf{T}WX)^{-1}x_i\), and \(X^\mathsf{T}WX=\mathcal I(\hat\beta)\). For the second expression, each expanded trial at covariate \(x_i\) has working weight \(\hat p_i(1-\hat p_i)\), while the information matrix is unchanged: summing the \(m_i\) identical trial contributions gives \(m_i\hat p_i(1-\hat p_i)x_ix_i^\mathsf{T}\). Therefore each trial's diagonal leverage is \(\hat p_i(1-\hat p_i)x_i^\mathsf{T}\mathcal I(\hat\beta)^{-1}x_i=h_i/m_i\). The group leverage is the sum of the leverages of its \(m_i\) expanded trials.

This relationship prevents a common comparison error. A grouped row represents several trials, so its leverage is not the leverage of one Bernoulli observation. Moreover, a large \(m_i\) does not guarantee large leverage: leverage also depends on how unusual \(x_i\) is relative to the rest of the design and on the fitted variance \( \hat p_i(1-\hat p_i)\).

Worked Example: Trial Counts in an Intercept-Only Model

Consider three groups with trial counts \(m=(2,8,10)\) in an intercept-only logistic model. The total number of trials is \(M=20\). In an intercept-only model all design values are \(x_i=1\), so the information is \(M\hat p(1-\hat p)\).

The leverage of group \(i\) is $$ h_i=\frac{m_i\hat p(1-\hat p)}{M\hat p(1-\hat p)}=\frac{m_i}{M}. $$ Thus the grouped-row leverages are \(2/20=0.10\), \(8/20=0.40\), and \(10/20=0.50\). Expanding the data, each trial has leverage \(1/20=0.05\). The first group has two trials, whose leverages sum to \(0.10\); the second has eight, summing to \(0.40\); and the third has ten, summing to \(0.50\). The grouped leverage records the combined contribution of the group's trials, not the leverage of a single trial.

Approximating the Effect of Deleting a Group

Write \(U_i(\beta)=x_i(y_i-m_i p_i)\) for the score contribution of group \(i\), and let \(U(\beta)=\sum_i U_i(\beta)\). At the full-data maximum-likelihood estimate, \(U(\hat\beta)=0\). Deleting group \(i\) leaves score \(U_{-i}(\hat\beta)=-U_i(\hat\beta)\) when evaluated at the full-data estimate. The deleted fit \(\hat\beta_{(-i)}\) is generally not available from this score alone, but a first-order Taylor expansion gives a useful local approximation.

Result: Let \(\mathcal I_{-i}=\mathcal I(\hat\beta)-w_i x_i x_i^\mathsf{T}\), the information with group \(i\)'s contribution removed but evaluated at \(\hat\beta\). If \(\mathcal I_{-i}\) is nonsingular and the deleted estimate is sufficiently close to \(\hat\beta\) for a first-order expansion to be adequate, then $$ \hat\beta_{(-i)}-\hat\beta\ \approx\ -\mathcal I_{-i}^{-1}x_i(y_i-m_i\hat p_i) =-\frac{\mathcal I(\hat\beta)^{-1}x_i(y_i-m_i\hat p_i)}{1-h_i}, $$ provided \(h_i<1\).

For the first approximation, expand the deleted score around \(\hat\beta\). Its derivative there is \(-\mathcal I_{-i}\), so with \(\delta=\hat\beta_{(-i)}-\hat\beta\), $$ 0=U_{-i}(\hat\beta_{(-i)})\ \approx\ -U_i(\hat\beta)-\mathcal I_{-i}\delta. $$ Solving gives \(\delta\approx-\mathcal I_{-i}^{-1}U_i(\hat\beta)\). To obtain the second expression, put \(A=\mathcal I(\hat\beta)\), \(w_i=m_i\hat p_i(1-\hat p_i)\), and \(h_i=w_i x_i^\mathsf{T}A^{-1}x_i\). The Sherman–Morrison identity gives $$ (A-w_i x_i x_i^\mathsf{T})^{-1}x_i=\frac{A^{-1}x_i}{1-w_i x_i^\mathsf{T}A^{-1}x_i}=\frac{A^{-1}x_i}{1-h_i}. $$ Substitution yields the stated formula. In the grouped-row hat matrix, \(0\leq h_i\leq 1\); the approximation requires \(h_i<1\) so that the deleted information is nonsingular in this direction. The approximation is local, not an exact deletion identity. Large residuals, high leverage, or a deleted fit far from the full fit can make it inaccurate.

Worked Example: Exact and Approximate Deletion in an Intercept-Only Fit

Use three groups with \((m_i,y_i)=(2,0),(8,4),(10,8)\). There are 12 successes among 20 trials, so \(\hat p=12/20=0.6\), \(\hat\beta=\log(0.6/0.4)=\log(1.5)\approx0.4055\), and \(\mathcal I=20(0.6)(0.4)=4.8\).

For group 3, \(h_3=10/20=0.5\) and its score contribution is \(y_3-m_3\hat p=8-6=2\). The one-step approximation is $$ \hat\beta_{(-3)}-\hat\beta\ \approx\ -\frac{(1/4.8)(2)}{1-0.5} =-0.8333. $$ The exact deleted fit excludes all 10 trials in group 3. The remaining groups have 4 successes in 10 trials, so \(\hat p_{(-3)}=0.4\), \(\hat\beta_{(-3)}=\log(0.4/0.6)=\log(2/3)\approx-0.4055\). The exact coefficient change is \(-0.4055-0.4055=-0.8109\), reasonably close to the local approximation in this example.

The comparison also shows why trial count alone is not a complete influence measure. Group 3 has half of the total trials and a substantial score residual; the deletion changes both the fitted probability and the coefficient. A group with the same trial count but an observed proportion nearer \(0.6\) would have a smaller score contribution and could change the fit less.

Grouped Deletion Is Not Single-Trial Deletion

For independent Bernoulli trials with common covariate \(x_i\), the grouped likelihood differs from the product of the individual Bernoulli likelihoods only by a factor that does not depend on \(\beta\). Consequently, fitting the grouped and expanded data gives the same coefficient estimates. But a case-deletion analysis depends on what counts as a case: deleting one grouped row removes all its trials, whereas deleting one expanded row removes just one trial.

Worked Example: Removing a Group Versus Removing One Trial

Suppose there are two groups, each with 10 trials: the first has 8 successes and the second has 4. In an intercept-only model, the full estimate is \(\hat p=12/20=0.6\), with \(\hat\beta=\log(1.5)\approx0.4055\). The leverage of either grouped row is \(10/20=0.5\), while each individual trial has leverage \(1/20=0.05\).

Deleting the first group removes its 8 successes and 2 failures. The remaining proportion is \(4/10=0.4\), giving coefficient change \(\log(0.4/0.6)-\log(1.5)=\log(2/3)-\log(1.5)\approx-0.8109\).

Instead, delete one success trial from that group. The remaining data have 11 successes in 19 trials, so the fitted odds are \(11/8\), and the coefficient change is $$ \log(11/8)-\log(12/8)=\log(11/12)\approx-0.0870. $$ Deleting one failure from that group instead leaves 12 successes in 19 trials; the odds become \(12/7\), and the coefficient change is \(\log(12/7)-\log(12/8)=\log(8/7)\approx0.1335\). Neither single-trial deletion is the whole-group deletion. The grouped observation's leverage is the sum of the ten individual leverages, but its deletion removes ten outcomes together, with their actual mix of successes and failures.

Interpreting Influence Carefully

Leverage describes the design-and-weight contribution to the fitted geometry; it is not, by itself, evidence that a group strongly changes the coefficients. The deletion approximation combines leverage with the score residual \(y_i-m_i\hat p_i\), and the factor \(1/(1-h_i)\) reflects the loss of information in the group's direction. A group can have high leverage but a small residual, or a large residual but modest leverage. Its actual influence should be understood through both features and, when needed, by refitting the model after deletion.

  • Wrong: “This group has 100 trials, so it must have high leverage and be influential.”
  • Correction: Its information weight scales with 100, but leverage also depends on its covariate position relative to the full design and its fitted probability. Influence additionally depends on its score residual, and the deletion effect may require an exact refit.
  • Wrong: “A grouped row and any one of its Bernoulli trials are the same case for influence analysis.”
  • Correction: A grouped-row deletion removes all trials in the group. The leverage of the group is the sum of the individual-trial leverages, but its deletion effect depends on removing the entire observed success/failure composition.
Key takeaway: In grouped logistic regression, trial counts scale information and group leverage. A group's leverage is the sum of its expanded-trial leverages, while case-deletion influence also depends on the observed score residual and on whether deletion removes the whole group or only one trial.

Check Your Understanding

Use the definitions and derivations above to answer the following.

  1. In an intercept-only model with groups of 5 and 15 trials, what are the grouped-row leverages and the leverage of each expanded Bernoulli trial?
  2. Why does doubling \(m_i\) double group \(i\)'s information contribution when \(x_i\) and \(\hat p_i\) are fixed?
  3. Which two features of a group appear in the one-step approximation to its coefficient change, in addition to the overall information matrix?
  4. Explain why deleting a whole group is not equivalent to deleting one success trial from that group.
  5. Can a group with many trials necessarily be called influential from its trial count alone? Give the relevant considerations.
Clinical Biostats