Why the Weights Matter
A fitted mean for a profile describes the model’s predicted average outcome for individuals with that profile. When we combine predictions across several profiles, the calculation needs weights. Giving every profile the same weight answers a different question from weighting profiles according to how common they are in a particular population. The arithmetic may look similar, but the average represents a different collection of people.
For example, suppose predictions are available for three age groups. Averaging the three predictions equally represents an average across the three listed age groups, treating each group as equally important. Weighting by the proportions of those age groups in a target population represents the predicted average for a population with that age distribution. Neither choice is automatically correct: the appropriate weights depend on the quantity we want to describe.
A profile is a specified combination of predictor values or categories. For example, a profile might be a particular age group and smoking category. A fitted mean for that profile is a conditional mean prediction: it describes the model’s predicted average outcome for individuals with those predictor values. An averaged mean combines several such predictions; its interpretation depends on both the profiles included and the weights assigned to them.
Equal Weights and Population Weights
An equally weighted average gives each listed profile the same contribution, regardless of how frequent that profile is in the population. It is useful when the desired summary treats each profile as equally important, or when the target itself is defined as the average across those profiles. It does not generally describe the average outcome among individuals in a population where the profiles have different frequencies.
Population weights instead use the shares of a specified target population in each profile. If profile \(j\) contains a proportion \(w_j\) of that population, then its fitted mean contributes \(w_j\hat{\mu}_j\) to the weighted average. These weights must refer to the population the analysis is intended to represent. For example, proportions in a study sample are not automatically appropriate if the target population has a different profile distribution.
When the profiles form mutually exclusive and exhaustive groups in a discrete target population, the population-weighted average has a direct interpretation as that population’s average conditional mean. The weights are the population proportions in the groups. If the profiles are only a selected set of examples, or if they do not cover the target population, an average over them represents only that chosen set unless additional assumptions justify another interpretation.
The identity follows by splitting the population according to its profile. Each individual belongs to exactly one profile, so the overall mean is the sum of the profile-specific means, each multiplied by the proportion of individuals in that profile:
Here \(I(X=x_j)\) equals 1 for individuals in profile \(j\) and 0 otherwise. The second equality uses the definition of a conditional mean: \(E\bigl(Y\,I(X=x_j)\bigr)=P(X=x_j)E(Y\mid X=x_j)\). This is the reason population proportions, rather than equal weights by default, are used when the target is an average over individuals.
Calculating Both Averages
Worked Example: Three Age Profiles
Suppose a fitted regression model predicts annual clinic visits for three age profiles: 2 visits for ages 18–39, 5 visits for ages 40–64, and 8 visits for ages 65 and older. These are hypothetical predictions. Calculate the equally weighted average and the population-weighted average if the target population is 50% ages 18–39, 30% ages 40–64, and 20% ages 65 and older.
Equal weights. There are three profiles, so each receives weight \(1/3\):
The equally weighted average is 5 predicted visits per year. It represents the average of the three profile predictions when each age group is given equal importance. It does not use the fact that the groups have different population sizes.
Population weights. The target proportions are 0.50, 0.30, and 0.20, which sum to 1:
The population-weighted average is 4.10 predicted visits per year for a population with the stated age distribution. It is lower than the equal-weighted average because the two younger profiles, which have lower predictions, together make up 80% of the target population.
The calculation illustrates a general point: the weights are part of the definition of the reported average, not a cosmetic choice made after the predictions are obtained. Keep the fitted means fixed and change the weights, and the average can change because a different population or profile mix is being represented.
Using Common Weights to Compare Groups
Weights are also important when comparing predicted means across groups. Suppose the fitted means for each group are available at several profiles. Averaging each group’s predictions with the same weights compares the groups under a common profile distribution. If each group instead receives weights based on its own profile distribution, the averages combine differences in predicted means with differences in profile composition.
A common weighted comparison is a description of model-predicted means under the chosen distribution. By itself, it does not establish that group membership causes an outcome difference. The choice of weights specifies the distribution over which the predictions are averaged; interpretation still depends on the model, the data, and the question being asked.
Worked Example: Comparing Two Groups at Two Risk Profiles
A fitted model gives the following hypothetical predicted numbers of recovery days for two groups at two baseline-risk profiles. The target population is 80% low risk and 20% high risk. Calculate each group’s equal-weighted average, then its average under the target population weights.
| Group | Low-risk profile | High-risk profile |
|---|---|---|
| A | 10 days | 20 days |
| B | 12 days | 23 days |
Equal-weighted averages. Each profile receives weight \(1/2\):
Under equal profile weights, Group B’s average predicted recovery time is \(17.5-15=2.5\) days greater than Group A’s.
Common target-population weights. Give the low-risk profile weight 0.80 and the high-risk profile weight 0.20 for both groups:
With this common profile distribution, Group B’s weighted predicted mean is \(14.2-12=2.2\) days greater. This is a model-based comparison standardized to the stated 80% low-risk and 20% high-risk distribution. It is not the difference between the groups’ observed overall means, and it does not by itself support a causal interpretation.
Choosing Weights for the Question
Before calculating an averaged prediction, state what population or collection of profiles the average is intended to describe. Then choose weights to match that target. If the aim is an average across a list of profiles treated equally, use equal weights. If the aim is an average over a target population divided into profiles, use that population’s profile proportions. When comparing groups under a common target distribution, apply the same weights to each group.
In some settings, the population proportions are known; in others, they are estimated from a sample or supplied by a separate population source. The source matters because the weights determine which population the result represents. If weights are estimated, the numerical average also reflects that choice of estimates, but the main interpretation remains tied to the distribution those weights are intended to describe.
A finite set of profiles may stand in for a broader range of predictor values only if it adequately represents the target distribution. For example, using one representative profile per age band assumes that those profiles are suitable summaries of the bands for the purpose at hand. If the target population includes profiles absent from the calculation, the resulting average does not automatically describe the whole population.
Common Mistake
Incorrect reasoning: “There are three profiles, so I should always divide the sum of their predictions by three to get the overall predicted mean.” This treats each profile as equally common, even when the target population has very different profile proportions.
Correction: Dividing by three gives an equally weighted profile-average. It is appropriate only when the desired summary gives the three profiles equal weight. To describe a population with unequal profile frequencies, multiply each fitted mean by its target-population proportion and add the contributions. State the weights and the population they represent so the interpretation is clear.
Check Your Understanding
For each question, identify what the weights make the average represent.
- Three profile predictions are 4, 7, and 10. Calculate their equally weighted average.
- Using the same predictions, calculate the weighted average for a target population with profile proportions 0.20, 0.50, and 0.30.
- Why might an equally weighted average differ from a population-weighted average even though the fitted predictions are identical?
- Two groups’ predictions are averaged with different profile weights. What makes it difficult to interpret their difference as a comparison under a common profile distribution?
- A target population includes profiles that are not represented in the set of predictions. What limitation should be stated when reporting an average over the listed profiles?