Tutorials › Generalized Linear Models › Standardized Expected Counts by Averaging

Count Effects and Predictions · Tutorial 480 of 981

Standardized Expected Counts by Averaging

Estimate a target-population expected count by predicting for each covariate profile and averaging with the target distribution’s weights.

Intermediate 10 min read

What You'll Learn

  • Define a standardized expected count for a specified target covariate distribution
  • Calculate a weighted average of profile-specific fitted means
  • Standardize to a target mix different from the fitted sample’s mix
  • Handle continuous covariates and exposure offsets in the prediction step
  • Explain why predicting at average covariates generally gives a different result
  • State conditions under which the plug-in standardized estimate is consistent

Why Average Predictions Over a Target Distribution?

A fitted count model gives a conditional mean for a particular covariate profile. Often the question is broader: what expected count would the model imply for a population with a specified mix of profiles? The answer depends on that mix. For example, the average fitted count in a clinic sample need not represent the average for a target population with a different age or treatment distribution.

Standardization makes the target mix explicit. Predict the conditional mean at each target profile, then average those predictions using the target distribution’s weights. This is an average of predicted counts, not a prediction for a single “average” profile.

Definition: Let \(X\) denote a covariate profile and suppose the conditional expected count under a fitted model is \(m(x;\beta)=E[Y\mid X=x]\), with model parameter \(\beta\). For a specified target distribution \(Q\) of covariates, the standardized expected count is $$ \mu_Q(\beta)=\int m(x;\beta)\,dQ(x). $$ If the target consists of profiles \(x_1,\ldots,x_K\) with weights \(w_1,\ldots,w_K\), where \(w_k\geq 0\) and \(\sum_{k=1}^K w_k=1\), then $$ \mu_Q(\beta)=\sum_{k=1}^K w_k m(x_k;\beta). $$ The plug-in estimate replaces \(\beta\) with its fitted estimate \(\hat{\beta}\): \(\hat{\mu}_Q=\sum_{k=1}^K w_k m(x_k;\hat{\beta})\).

For a Poisson log-mean model, a common specification is \(m(x;\beta)=\exp\{z(x)^\mathsf{T}\beta\}\), where \(z(x)\) is the model’s design vector, including any intercept and terms for the covariates. An exposure offset can also be included in the linear predictor. The averaging rule itself does not depend on the Poisson distribution: it uses the model’s conditional mean.

Finite Target Distributions: Predict, Then Weight

For a finite target distribution, the calculation has two distinct parts. First, use the fitted model to predict the mean count at each target profile. Second, multiply each prediction by that profile’s target weight and add. The weights describe the target population, not necessarily the proportions of profiles in the data used to fit the model.

Worked Example: Standardizing Across a Binary Covariate

Suppose the fitted log-mean model is \(\log m(A)=\log 2+(\log 3)A\), where \(A\) is a binary covariate. In the target population, 25% have \(A=1\) and 75% have \(A=0\). Find the standardized expected count.

At \(A=0\), the fitted mean is \(m(0)=\exp(\log 2)=2\). At \(A=1\), it is \(m(1)=\exp(\log 2+\log 3)=6\). Therefore, $$ \hat{\mu}_Q=0.75(2)+0.25(6)=1.5+1.5=3. $$ The standardized expected count is 3 per target individual. The weights are applied to the predicted means; they are not used to average the covariate values first.

The target weights can be chosen to represent a population other than the study sample. In that case, the standardized estimate answers a different question from the sample’s average fitted mean. The fitted model supplies predictions, while the target distribution determines which predictions contribute, and how much.

Worked Example: A Target Mix Different From the Study Mix

A fitted model for two binary covariates \(A\) and \(B\) is \(\log m(A,B)=\log 2+(\log 2)A+(\log 1.5)B\). The target profile weights are 0.2 for \((A,B)=(0,0)\), 0.3 for \((1,0)\), 0.1 for \((0,1)\), and 0.4 for \((1,1)\). Calculate the standardized expected count.

The profile-specific fitted means are \(m(0,0)=2\), \(m(1,0)=2\times2=4\), \(m(0,1)=2\times1.5=3\), and \(m(1,1)=2\times2\times1.5=6\). The weights are nonnegative and sum to \(0.2+0.3+0.1+0.4=1\), so they define a target distribution. The weighted average is $$ \hat{\mu}_Q=0.2(2)+0.3(4)+0.1(3)+0.4(6) =0.4+1.2+0.3+2.4=4.3. $$ This is the average predicted count for the stated target mix. If the study sample had different proportions in these four profiles, averaging its predictions with its own proportions would generally give a different quantity.

Continuous Covariates and Nonlinear Means

When the target covariate distribution is continuous, the standardized mean is an integral. In practice, the target distribution might be specified analytically, represented by a weighted sample, or approximated by a set of profiles with weights. The essential operation remains the same: evaluate the conditional mean across the target distribution and average.

Worked Example: Standardizing Over a Continuous Covariate

Let \(X\) be uniformly distributed on \([0,1]\) in the target population, and suppose the fitted conditional mean is \(m(x)=2\cdot 3^x\). Find the standardized expected count. Compare it with the prediction at the target mean covariate.

Since the uniform density on \([0,1]\) is 1, $$ \hat{\mu}_Q=\int_0^1 2\cdot3^x\,dx =2\left[\frac{3^x}{\log 3}\right]_0^1 =\frac{2(3-1)}{\log 3} =\frac{4}{\log 3} \approx 3.641. $$ The target mean covariate is \(E_Q[X]=0.5\). Predicting at that value gives \(m(0.5)=2\cdot3^{0.5}=2\sqrt{3}\approx3.464\), which is not the standardized expected count. The target asks for the average of the profile-specific means, not the mean evaluated at the average profile.

Theorem: Suppose \(m(x;\beta)=\exp\{a(x)+b(x)^\mathsf{T}\beta\}\) is integrable under a target distribution \(Q\). If \(a(X)+b(X)^\mathsf{T}\beta\) is integrable, then $$ E_Q[m(X;\beta)]\geq \exp\!\left(E_Q[a(X)+b(X)^\mathsf{T}\beta]\right). $$ Equality holds if and only if the linear predictor \(a(X)+b(X)^\mathsf{T}\beta\) is constant \(Q\)-almost surely.

Proof. Set \(Z=a(X)+b(X)^\mathsf{T}\beta\). The exponential function is strictly convex, so Jensen’s inequality gives \(E_Q[\exp(Z)]\geq\exp(E_Q[Z])\). Since \(m(X;\beta)=\exp(Z)\), this is the stated inequality. Strict convexity implies equality exactly when \(Z\) is constant \(Q\)-almost surely. \(\square\)

This result explains why substituting average covariate values is not generally a valid shortcut. With multiple covariates, the average of each covariate does not in general determine the average of the exponential mean. The shortcut agrees only in special cases, such as when the linear predictor is constant across target profiles.

Offsets and the Meaning of the Standardized Quantity

An offset changes the conditional mean being averaged, so it must be set to the value relevant to each target profile. For a count observed over exposure \(t\), a common model is \(\log m(x,t;\beta)=\log t+z(x)^\mathsf{T}\beta\). The prediction is then an expected count over exposure \(t\), not a rate per unit exposure. Standardizing counts requires specifying the target exposure distribution as well as the covariate distribution.

Worked Example: Standardizing Counts With Different Exposures

Suppose \(\log m(A,t)=\log t+\log 1.2+(\log 2)A\), where \(t\) is exposure. The target has weight 0.6 at \((A,t)=(0,1)\) and weight 0.4 at \((A,t)=(1,3)\). Find the standardized expected count.

For the first profile, \(m(0,1)=1\times1.2\times1=1.2\). For the second, \(m(1,3)=3\times1.2\times2=7.2\). Thus $$ \hat{\mu}_Q=0.6(1.2)+0.4(7.2)=0.72+2.88=3.6. $$ This is an expected count averaged over the specified mix of exposures and covariate values. It is not the standardized rate per unit exposure; calculating a rate would require defining a rate estimand and its weighting rule separately.

Why the Plug-In Average Targets the Desired Mean

For a finite set of target profiles, replacing the model parameter by its estimate and then averaging gives a direct plug-in estimator of the target mean. Its consistency follows from the continuity of the fitted mean and the finite weighted sum; the target weights must describe the target distribution and be treated as fixed for this result.

Theorem: Let \(x_1,\ldots,x_K\) be fixed target profiles and \(w_1,\ldots,w_K\) fixed nonnegative weights summing to one. Suppose \(\hat{\beta}\xrightarrow{p}\beta_0\), and for each \(k\), \(m(x_k;\beta)\) is continuous at \(\beta_0\). Then $$ \hat{\mu}_Q=\sum_{k=1}^K w_km(x_k;\hat{\beta}) \xrightarrow{p} \sum_{k=1}^K w_km(x_k;\beta_0)=\mu_Q(\beta_0). $$

Proof. For each fixed \(k\), consistency of \(\hat{\beta}\) and continuity of \(m(x_k;\cdot)\) imply \(m(x_k;\hat{\beta})\xrightarrow{p}m(x_k;\beta_0)\) by the continuous mapping theorem. Because there are finitely many profiles, the vector of these fitted means converges in probability to the vector of true means. The weighted-sum map \((u_1,\ldots,u_K)\mapsto\sum_{k=1}^K w_ku_k\) is continuous. Applying the continuous mapping theorem again gives the displayed convergence. \(\square\)

This result concerns estimation of the standardized mean when the target profiles and weights are fixed. If the target weights are themselves estimated, their estimation uncertainty must also be considered; treating uncertain weights as fixed does not account for it.

Common Mistakes and a Practical Checklist

  • Predicting at average covariates. This usually computes \(m(E_Q[X];\hat{\beta})\), not \(E_Q[m(X;\hat{\beta})]\). With a nonlinear log-mean model, those quantities generally differ.
  • Using the study sample’s mix by default. That estimates an average for the study’s covariate distribution. Use the specified target weights if the intended population has a different mix.
  • Forgetting that weights must define the target. For a weighted average, weights should be nonnegative and sum to one. If raw weights do not sum to one, normalize them by their sum when that is the intended averaging scheme.
  • Confusing a standardized count with a total. The weighted average is an expected count per target individual (or per defined observational unit). It is not the sum of expected counts across a population.
  • Ignoring exposure. If exposures differ across target profiles, use each profile’s exposure in its count prediction and state clearly that the result is an average count over that exposure mix.
1
Specify the target.
State which covariate profiles or distribution define the population of interest.
2
Set the weights.
Assign each profile its target weight, ensuring that weights are nonnegative and sum to one for an average.
3
Predict at every profile.
Use the fitted conditional-mean model and the appropriate exposure offset for each profile.
4
Average the predictions.
Multiply each fitted mean by its target weight and add the weighted values.

Check Your Understanding

Use the distinction between a profile-specific prediction and a target-distribution average in each answer.

  1. A target has weights 0.7 and 0.3 on two profiles whose fitted means are 2 and 5. What is the standardized expected count?
  2. Why does predicting at the mean value of a continuous covariate generally not give the standardized expected count in a log-mean model?
  3. If the target population has different profile proportions from the study sample, which proportions should be used for standardization, and why?
  4. A model includes an exposure offset, and target profiles have different exposures. What must be specified to interpret the standardized quantity as an expected count?
  5. What assumptions about fixed target profiles, weights, continuity, and parameter estimation justify consistency of the finite-profile plug-in average?
Clinical Biostats