From One Profile to an Average Across Profiles
A fitted regression model can predict an outcome mean for a group at a specified covariate profile. But a single profile may not summarize the range of covariate values that matters for a question. For example, to compare two groups across several baseline scores, we can predict the mean outcome for each group at each selected score and average those predictions. The resulting group summaries are marginal means over the chosen profiles.
The word “marginal” here means that the predictions have been averaged over the covariate profiles being considered. It does not mean that there is one universal marginal mean that applies regardless of which profiles are selected. The set of profiles helps define the quantity being reported.
This definition requires a model that supplies a predicted conditional mean at each group-profile combination. In using those predictions, we assume the fitted conditional-mean model is suitable for the question, and that the selected profiles are meaningful for the population or comparison of interest. In particular, predictions for profiles far outside the range represented by the data may be unreliable extrapolations. The average describes the specified profiles; it does not automatically describe every possible population.
The calculation is direct: keep the profile set fixed, calculate a prediction for the group at every profile, and take their arithmetic mean. If comparing groups, using the same profiles for each group makes the comparison refer to the same profile distribution. The examples below use equal weights only; the profiles and their equal contributions define the target summary.
Calculating and Interpreting the Average
Worked Example: Averaging Predictions Across Baseline Scores
Suppose a hypothetical study has a fitted model for a follow-up score, \(Y\), with group indicator \(G\) (0 for the comparison group and 1 for the program group) and baseline score \(x\):
The question is to report equal-profile marginal means for both groups over baseline scores \(x=20,30,40\). These are three stated profiles, and the model gives a fitted mean at each of them.
For \(G=0\), the predictions are \(50+0.5(20-30)=45\), \(50+0.5(30-30)=50\), and \(50+0.5(40-30)=55\). Their average is
For \(G=1\), the predictions are \(50+8+0.5(20-30)=53\), \(50+8+0.5(30-30)=58\), and \(50+8+0.5(40-30)=63\). Thus
The estimated equal-profile marginal means are 50 and 58 follow-up-score points. They summarize predictions across the three specified baseline scores, with each score contributing equally. The fitted means at the single profile \(x=30\) are also 50 and 58 in this example, but that match is a consequence of these particular profiles and this linear model; it is not the definition of an averaged mean.
A marginal mean differs in purpose from a prediction at one common profile. The single-profile prediction answers, “What conditional mean does the model predict for this group at this particular covariate profile?” The equal-profile marginal mean answers, “What is the average of the group’s predicted conditional means across this specified set of profiles?” One number is not inherently more appropriate: the choice depends on the question.
Worked Example: Averaging When Groups Have Different Slopes
Consider a second hypothetical fitted model for an outcome measured in points:
The interaction term means that the predicted change associated with \(x\) differs by group. We will average over the same three profiles, \(x=3,5,7\), for both groups.
For \(G=0\), the interaction term is zero. The predictions are \(100+2(3-5)=96\), \(100+2(5-5)=100\), and \(100+2(7-5)=104\). Therefore,
For \(G=1\), both the group term and the interaction contribute. At \(x=3\), the prediction is \(100+10+2(-2)+3(-2)=100\). At \(x=5\), it is \(100+10=110\). At \(x=7\), it is \(100+10+2(2)+3(2)=120\). Hence,
Across these profiles, the estimated marginal means are 100 and 110 points. A common-profile comparison at \(x=3\) would instead be 96 versus 100 points, while at \(x=7\) it would be 104 versus 120 points. The group difference varies with the profile, so one profile-specific comparison cannot stand in for the average across all three. Averaging makes the chosen set of profiles explicit.
Why an Average of Predictions Is Not Always a Prediction at the Average
It may seem simpler to average the covariate values first and make one prediction there. That shortcut is not generally valid. For a model that is linear in a quantitative covariate, averaging predictions across profiles does equal the prediction at the average covariate value, provided the same profiles and equal weights are used. This follows from the algebra of an affine model.
For example, suppose \(\hat m(g,x)=a_g+b_gx\), where \(a_g\) and \(b_g\) are fixed for group \(g\). For profiles \(x_1,\ldots,x_K\),
where \(\bar{x}_{\mathrm{profiles}}=K^{-1}\sum_{j=1}^{K}x_j\) is the mean of the selected profile values. The equality comes from distributing the sum across the constant and covariate terms. It does not establish the same result for models with nonlinear terms, nor does it make a prediction at the average profile equivalent to a general profile average.
Worked Example: A Quadratic Model Gives a Different Result
Suppose a hypothetical fitted model for an outcome measured in units is
We will calculate equal-profile marginal means over \(x=0,2,4\). These profiles have mean covariate value \((0+2+4)/3=2\).
For \(G=0\), the predictions are \(20+2(0)+0.5(0^2)=20\), \(20+2(2)+0.5(2^2)=26\), and \(20+2(4)+0.5(4^2)=36\). The averaged prediction is
For \(G=1\), the group term adds 4 at every profile. The predictions are 24, 30, and 40, so
If instead we predict only at the mean profile \(x=2\), the fitted means are \(20+2(2)+0.5(2^2)=26\) for \(G=0\) and \(30\) for \(G=1\). Those differ from 27.33 and 31.33. The quadratic term makes the prediction a curved function of \(x\); the average of its values at the three profiles need not equal its value at their average. Both calculations are valid, but they answer different questions.
What the Marginal Mean Represents
An equal-profile marginal mean is a summary of model-based conditional means, not a new kind of observed outcome. In particular, it is not necessarily the raw average outcome among people in that group. The raw average reflects the covariate profiles actually present in that group, while the marginal mean above averages fitted predictions over the profiles explicitly selected for the calculation. These quantities can differ, especially when groups have different covariate distributions.
The profile set therefore matters substantively. If it consists of a few scores selected for a clear comparison, the result describes the average fitted mean across those scores. If it is meant to represent a broader target population, the profiles should be relevant to that population. The calculation itself cannot make an unrepresentative set representative. A different averaging scheme can define a different target summary; the key is to state what was averaged.
The fitted model also matters. Averaging predictions does not correct a poorly specified conditional-mean relationship, nor does it justify predictions at implausible profiles. Before interpreting the result, check that the model includes the group and covariate relationships needed for the question, and that predictions are being made where the data provide a reasonable basis for them. These are conditions for giving the model-based summary a useful interpretation, not extra arithmetic steps.
Common Mistake
- Wrong reasoning: “The average profile value is 2, so the marginal mean must be the model prediction at \(x=2\).” This assumes that averaging covariates and predicting is always equivalent to predicting at every profile and averaging.
- Correction: Calculate the predictions for the specified profiles and average them. Substituting the average profile gives the same result for an affine model in the covariate, but can differ for a quadratic or other nonlinear relationship. Check the model form before using that shortcut.
- Another interpretation to avoid: An averaged fitted mean is not automatically the observed group mean or a causal effect. It is a model-based average over the stated profiles; causal claims require additional justification beyond this calculation.
Check Your Understanding
Use the definition and calculations above to answer these questions.
- A fitted model gives predictions of 12, 15, and 18 for one group at three specified profiles. What is its equal-profile marginal mean, and what does it summarize?
- Why should two groups generally be predicted over the same profile set when the aim is a directly comparable averaged summary?
- For an affine model in one covariate, under what averaging conditions does the average of the predictions equal the prediction at the mean covariate value?
- In the quadratic example, why did predicting at \(x=2\) not reproduce the average across \(x=0,2,4\)?
- Explain why an equal-profile marginal mean need not equal the raw observed mean for the group.