Tutorials › Regression Analysis (Undergraduate) › Choosing Weights for Averaged Means

Predictions for Conditional Means · Tutorial 706 of 991

Choosing Weights for Averaged Means

Learn to calculate averaged profile predictions using equal or population-based weights, and explain which population each choice describes.

Beginner 10 min read

What You'll Learn

  • Calculate an equally weighted average of fitted means across profiles.
  • Calculate a weighted average using target-population profile proportions.
  • Explain how weights define the population represented by an averaged mean.
  • Distinguish a profile-average from a population-average.
  • Use the same target weights to compare predicted means across groups.
  • Recognize when a set of profiles does not adequately represent the target population.

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.

Definition: Given fitted conditional means \(\hat{\mu}_1,\ldots,\hat{\mu}_J\) for \(J\) profiles and weights \(w_1,\ldots,w_J\), the weighted average of the profile predictions is \(\sum_{j=1}^{J} w_j\hat{\mu}_j\). For an ordinary weighted average, the weights are nonnegative and sum to 1. Equal weights use \(w_j=1/J\) for every profile. Population weights use the proportions of the target population in the corresponding profiles.

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.

$$ \text{Equal-weighted average} = \frac{1}{J}\sum_{j=1}^{J}\hat{\mu}_j $$
$$ \text{Population-weighted average} = \sum_{j=1}^{J} w_j\hat{\mu}_j, \qquad \sum_{j=1}^{J}w_j=1 $$

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.

Theorem: For a discrete profile variable \(X\) with possible profiles \(x_1,\ldots,x_J\), the population mean of the conditional means is \(\sum_{j=1}^{J}P(X=x_j)E(Y\mid X=x_j)\). Replacing each conditional mean with its fitted prediction gives the corresponding model-based population-weighted average, using the target population’s profile proportions as weights.

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:

$$ E(Y) = \sum_{j=1}^{J} E\bigl(Y\,I(X=x_j)\bigr) = \sum_{j=1}^{J}P(X=x_j)E(Y\mid X=x_j) $$

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\):

$$ \frac{2+5+8}{3} = \frac{15}{3} = 5 $$

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:

$$ (0.50)(2)+(0.30)(5)+(0.20)(8) = 1.00+1.50+1.60 = 4.10 $$

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.

GroupLow-risk profileHigh-risk profile
A10 days20 days
B12 days23 days

Equal-weighted averages. Each profile receives weight \(1/2\):

$$ \text{Group A: }\frac{10+20}{2}=15\text{ days} \qquad \text{Group B: }\frac{12+23}{2}=17.5\text{ days} $$

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:

$$ \text{Group A: }(0.80)(10)+(0.20)(20)=8+4=12\text{ days} $$
$$ \text{Group B: }(0.80)(12)+(0.20)(23)=9.6+4.6=14.2\text{ days} $$

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.

Key takeaway: An averaged fitted mean is defined by its profile predictions and its weights. Equal weights describe an equally weighted set of profiles; population weights describe a population with the corresponding profile distribution.

Check Your Understanding

For each question, identify what the weights make the average represent.

  1. Three profile predictions are 4, 7, and 10. Calculate their equally weighted average.
  2. Using the same predictions, calculate the weighted average for a target population with profile proportions 0.20, 0.50, and 0.30.
  3. Why might an equally weighted average differ from a population-weighted average even though the fitted predictions are identical?
  4. 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?
  5. 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?