Why the Marginal and Adjusted Associations Can Differ
Suppose a hypothetical evaluation records whether students attended a study workshop, their score on a later assessment, and their level of preparation before the workshop was offered. Students with stronger prior preparation may be more likely to attend and may also score higher. In that situation, the overall difference in scores between attendees and nonattendees can reflect both the workshop–score association within preparation levels and the different mix of preparation levels in the two attendance groups.
This tutorial calculates that difference in a small dataset. The purpose is to make the distinction between a marginal association and an adjusted association concrete. Neither estimate, by itself, proves that workshop attendance causes a score change.
A Hypothetical Dataset
Let \(X=1\) mean that a student attended the workshop and \(X=0\) mean that the student did not. Let \(Z=1\) indicate high prior preparation and \(Z=0\) indicate low prior preparation. The outcome \(Y\) is the assessment score, measured in points. The following eight observations are hypothetical.
| Student | Workshop, \(X\) | Preparation, \(Z\) | Score, \(Y\) (points) |
|---|---|---|---|
| A | 0 | 0 | 10 |
| B | 0 | 0 | 11 |
| C | 0 | 0 | 9 |
| D | 1 | 0 | 12 |
| E | 0 | 1 | 20 |
| F | 1 | 1 | 22 |
| G | 1 | 1 | 23 |
| H | 1 | 1 | 21 |
Preparation is associated with both variables in this dataset: three of the four highly prepared students attended, compared with one of the four students with low preparation; and the scores are higher in the high-preparation group. These patterns make preparation a plausible common cause in the example. The calculations that follow describe associations in these eight observations; the table alone cannot establish the causal relationships behind them.
Worked Example: Calculating the Marginal Association
First ignore preparation and compare the average score of workshop attendees with the average score of nonattendees. There are four students in each group. The marginal association is the attendees’ mean minus the nonattendees’ mean.
The attendees’ scores are 12, 22, 23, and 21, so their mean is
The nonattendees’ scores are 10, 11, 9, and 20, so their mean is
Therefore, the marginal difference is
In this dataset, attendees scored an average of 7.0 points higher than nonattendees. This is an unadjusted comparison: it does not hold prior preparation fixed, and it should not be described as the causal effect of attending the workshop.
Calculating the Adjusted Association
For this numerical example, use the additive linear regression model
Here, \(\beta_1\) is the model’s adjusted association between workshop attendance and score, in score points, for students with the same preparation value. The additive model assumes this conditional difference is the same at both preparation levels; it contains no \(X Z\) interaction. The coefficient \(\beta_2\) describes the model’s score difference by preparation level at a fixed workshop status.
The model is used as a description of conditional mean differences. For standard regression interpretation, observations are treated as independent, the conditional mean is represented by the stated additive form, and the errors have conditional mean zero given \(X\) and \(Z\). For inference using the usual small-sample \(t\) procedures, additional distributional and variance assumptions would be needed; no such inference is required for these calculations. To interpret \(\beta_1\) causally would require further design and causal assumptions that these data do not establish.
The cell means show the within-preparation comparisons directly. Among students with low preparation, the mean score is 10 points for nonattendees and 12 points for attendees. Among students with high preparation, it is 20 points for nonattendees and 22 points for attendees. Both within-level differences are 2 points. Because they agree, the additive model can represent all four cell means exactly.
Worked Example: Fitting the Adjusted Model
Calculate the outcome mean in each combination of attendance and preparation:
The low-preparation, nonattending cell has \(X=0\) and \(Z=0\), so its mean identifies the intercept in this model: \(\hat{\beta}_0=10\). At low preparation, changing \(X\) from 0 to 1 changes the fitted mean from 10 to 12, giving \(\hat{\beta}_1=12-10=2\) points. At \(X=0\), changing \(Z\) from 0 to 1 changes the fitted mean from 10 to 20, giving \(\hat{\beta}_2=20-10=10\) points.
Check the last cell: the model predicts \(10+2(1)+10(1)=22\) points, which matches the observed cell mean. Thus the fitted equation is
The adjusted attendance coefficient is \(\hat{\beta}_1=2\) points. Under this model, the average score is 2 points higher for attendees than nonattendees at either fixed preparation level. This conditional association is 5 points smaller than the marginal difference of 7 points.
Why the Estimates Differ: A Numerical Decomposition
The difference can be understood by separating the within-preparation association from the unequal composition of the attendance groups. For a binary exposure and binary covariate, write \(\mu_{xz}\) for the mean outcome among observations with \(X=x\) and \(Z=z\). The marginal mean for each exposure group averages its covariate-specific means using that group’s own covariate distribution. Adding and subtracting the same term gives
The first sum uses the within-preparation mean differences, weighted by the preparation distribution among attendees. The second sum reflects the fact that the preparation distributions differ between attendees and nonattendees. This identity is an arithmetic decomposition of the marginal difference; it does not by itself establish a causal interpretation.
Worked Example: Checking the Composition Component
In the first sum, the within-preparation difference is 2 points for both \(Z=0\) and \(Z=1\). The weights among attendees are \(P(Z=0\mid X=1)=1/4\) and \(P(Z=1\mid X=1)=3/4\). Thus the within-preparation component is
For the second sum, the nonattendees’ preparation-specific means are \(\mu_{00}=10\) and \(\mu_{01}=20\). Among attendees, the proportions with low and high preparation are \(1/4\) and \(3/4\); among nonattendees, they are \(3/4\) and \(1/4\). Therefore the composition component is
Adding the components gives \(2+5=7\) points, exactly the marginal difference calculated earlier. In these data, 2 points of the marginal comparison correspond to the common within-preparation difference, while 5 points arise from the groups having different preparation mixes. This is a description of the numerical contrast, not proof that the within-preparation difference is a causal effect.
A Common Preparation Distribution Gives Another View
One way to display a covariate-adjusted comparison is to calculate predicted means for both exposure levels using the same covariate distribution. Here, give each preparation level weight \(1/2\), the proportion with each level in the full dataset. This creates a standardized comparison in which the two exposure groups are compared using an identical preparation mix.
Worked Example: Comparing Scores With a Shared Preparation Mix
Using the four observed cell means, the standardized mean for attendees is
The standardized mean for nonattendees is
Their standardized difference is \(17-15=2\) points. This agrees with the adjusted regression coefficient because the within-preparation difference is 2 points in both strata. If those differences were not equal, a single additive regression coefficient would impose a common difference that did not match both stratum-specific comparisons.
Interpretation and a Common Pitfall
The numerical example makes the role of the common cause visible. High preparation is more common among workshop attendees, and high preparation is also associated with higher scores. Consequently, the marginal comparison of 7.0 points combines a 2-point within-preparation difference with a 5-point composition component. Adjusting for preparation changes the comparison to 2 points in the additive model.
A common mistake is to say, “The marginal difference is 7 points, so attending the workshop raises scores by 7 points,” or to assume that the adjusted estimate must be causal simply because a covariate was included. The first statement mistakes an unadjusted association for a causal effect. The second overlooks whether the measured covariate is an appropriate common cause, whether important causes remain unmeasured, and whether the model is suitable. Here, “adjusted” has a precise statistical meaning: the model compares attendance groups at the same value of the measured preparation variable. Causal conclusions require additional evidence and assumptions.
Check Your Understanding
Use the dataset and model in this tutorial to answer the following questions.
- What are the mean scores for attendees and nonattendees, and what is their marginal difference?
- Calculate the attendee–nonattendee score difference separately for \(Z=0\) and \(Z=1\).
- In the fitted additive model, what do \(\hat{\beta}_1\) and \(\hat{\beta}_2\) represent, including their units?
- Using the displayed decomposition, which component accounts for the difference between the 7-point marginal comparison and the 2-point within-preparation comparison?
- Why does calculating an adjusted association not, by itself, establish that workshop attendance causes a change in score?