Tutorials › Regression Analysis (Undergraduate) › Confounder, Mediator, or Prognostic Variable

Adjusted Associations and Confounding · Tutorial 182 of 991

Confounder, Mediator, or Prognostic Variable

Classify covariates by their causal role in an exposure–outcome question, and separate outcome prediction from confounding.

Intermediate 10 min read

What You'll Learn

  • Define confounders, mediators, and prognostic variables in relation to a specified exposure and outcome.
  • Use variable timing and directed arrows to distinguish common causes from intermediate variables.
  • Explain why an outcome predictor is not automatically a confounder.
  • Recognize when a variable can be both prognostic and a confounder.
  • Separate regression associations from the causal assumptions needed to interpret them.

Why Covariate Roles Matter

A regression model can include many variables that help describe or predict an outcome, but that does not make them interchangeable. When the aim is to understand the association between an exposure and an outcome, a covariate’s causal role matters: it may be a confounder, an intermediate step in a causal pathway, or simply a predictor of the outcome. Those roles are defined relative to a particular exposure and outcome, not by a variable’s name or by how strongly it predicts.

Consider a question about whether a treatment is associated with recovery time. Age, treatment adherence, and a baseline laboratory measurement might all help predict recovery time. Yet age could influence both treatment choice and recovery; adherence could occur after treatment and lie on a pathway to recovery; and the laboratory measurement could predict recovery without affecting treatment choice. Treating all three as equivalent “controls” would ignore important differences in their timing and causal relationships.

Definitions Based on a Causal Diagram

A directed acyclic graph (DAG) represents hypothesized causal relationships using variables as nodes and arrows as causal directions. A directed path follows the direction of its arrows. For an exposure \(X\) and outcome \(Y\), a backdoor path is a path from \(X\) to \(Y\) that begins with an arrow pointing into \(X\). Earlier material introduced how such paths can create confounding and how adjustment sets are assessed. Here, the focus is on identifying the roles of individual variables.

Definition: A confounder is, in the basic common-cause case, a variable \(C\) that causally influences both the exposure \(X\) and the outcome \(Y\), represented by \(C \rightarrow X\) and \(C \rightarrow Y\). It is a source of a backdoor path between \(X\) and \(Y\). A mediator is a variable \(M\) that lies on a causal pathway from exposure to outcome, such as \(X \rightarrow M \rightarrow Y\). A prognostic variable is a variable that predicts the outcome in the setting of interest. Prognostic describes outcome prediction; by itself, it does not specify a causal relationship with the exposure.

These labels depend on the question. A variable may be prognostic and also a confounder: a common cause of exposure and outcome will often predict the outcome. “Prognostic” does not mean “not a confounder.” The important distinction is that predicting \(Y\) alone is not enough to establish that a variable causes, or is associated through a causal path with, \(X\).

Timing helps organize the possibilities. A variable measured before the exposure cannot be a mediator of that exposure if it truly precedes it, but it is not automatically a confounder. It might predict the outcome without influencing exposure. A variable measured after exposure could be a mediator, but timing alone does not prove that it is: subject-matter knowledge is needed to justify the arrows. Measurement dates also need to reflect when the underlying processes occurred, not merely when records were entered.

Regression Prediction Is Not a Causal Diagram

For a numerical outcome, a regression model with exposure \(X\) and covariate \(Z\) might describe the conditional mean as follows:

$$ E(Y_i \mid X_i,Z_i)=\beta_0+\beta_X X_i+\beta_Z Z_i. $$

This equation says how the model represents the mean outcome at given values of \(X_i\) and \(Z_i\). It does not, by itself, establish arrows between the variables. For the equation to serve as an adequate conditional-mean summary, its functional form must be reasonable for the variables being modeled; interpreting a coefficient as causal would require additional causal assumptions and justification. In particular, a nonzero \(\beta_Z\) can reflect a predictive relationship with \(Y\) without \(Z\) being a cause of \(X\) or a source of a backdoor path.

The same caution applies to observed association. If \(Z\) and \(X\) are associated in the data, that does not prove \(Z \rightarrow X\). The association might arise because of other causes, selection, or chance. A causal diagram should be based on timing and subject-matter knowledge, not drawn by turning every statistical association into an arrow.

Worked Example: Age as a Potential Confounder

Suppose a hypothetical clinic compares a treatment \(X\) (Yes or No) with recovery time \(Y\), measured in days. Clinicians choose treatment partly using a patient’s age, and age also influences recovery time. The proposed diagram is \(C \rightarrow X\) and \(C \rightarrow Y\), where \(C\) is age group. The following hypothetical summary is consistent with that account.

Age groupTreated / totalMean recovery time
Younger20 / 1004 days
Older60 / 10010 days

The treatment proportions are \(20/100=0.20\) among younger patients and \(60/100=0.60\) among older patients. The observed mean recovery times are \(4\) and \(10\) days, respectively. Thus, age group is related to treatment assignment in these data and predicts recovery time; the stated clinical knowledge also supports arrows from age to both treatment and recovery.

Classification. Under the proposed causal account, age group is a potential confounder for the treatment–recovery question because it is a common cause of \(X\) and \(Y\). It is also prognostic, since recovery differs by age group. The calculations show descriptive patterns; they do not, on their own, prove the causal arrows or establish a treatment effect.

A Prognostic Variable Need Not Confound

A baseline variable can be useful for predicting an outcome without being a cause of exposure. For example, a biomarker might help predict recovery, while treatment assignment is randomized and therefore unrelated to the biomarker. In a diagram with \(Z \rightarrow Y\) and a separate causal arrow \(X \rightarrow Y\), the biomarker is prognostic but does not form a backdoor path from \(X\) to \(Y\).

Worked Example: A Prognostic Variable That Is Not a Confounder

Imagine a hypothetical randomized trial with 200 participants, split equally between treatment and comparison groups. A baseline biomarker \(Z\) is classified as low or high. The random assignment is independent of \(Z\), and the proposed diagram contains \(Z \rightarrow Y\) but no arrow from \(Z\) to \(X\). Recovery score \(Y\) is measured on a scale where higher scores are better.

Biomarker groupTreatment / totalMean recovery score
Low50 / 10072 points
High50 / 10084 points

The treatment proportions are \(50/100=0.50\) in both biomarker groups, consistent with the stated randomization. The difference in mean recovery scores by biomarker group is

$$ 84-72=12\text{ points}. $$

Classification. In this hypothetical setting, the biomarker is prognostic: the high-biomarker group has a mean recovery score 12 points higher. It is not a confounder in the proposed diagram because it does not cause treatment assignment or create a backdoor path between treatment and outcome. The outcome difference does not turn the biomarker into a confounder; it only demonstrates that the variable predicts the outcome in this example.

Recognizing a Mediator by Its Place in Time and Path

A mediator occurs after exposure in the causal sequence and is affected by the exposure. For instance, treatment may change adherence, which may then influence recovery. The arrows \(X \rightarrow M\) and \(M \rightarrow Y\) make adherence an intermediate variable on a pathway from treatment to recovery. Adherence may strongly predict recovery, but its defining feature as a mediator is its position on that pathway—not its predictive strength.

This classification requires care. A variable recorded after exposure is not necessarily a mediator; it might be unrelated to the exposure, or its causal relation to the outcome may be different from the one proposed. Conversely, an intermediate process can be measured later even if it began earlier. Establishing the role requires a defensible timeline and substantive knowledge of how the variables arise.

Worked Example: Adherence as a Mediator

Suppose a hypothetical study compares a new treatment \(X\) with usual care and records whether participants adhered to the prescribed regimen \(M\), followed by a recovery score \(Y\). The clinical account is that the treatment makes adherence more likely, and adherence improves recovery. The proposed path is \(X \rightarrow M \rightarrow Y\).

Assigned groupAdherent / totalMean recovery score
New treatment80 / 10082 points
Usual care60 / 10076 points

The adherence proportions are \(80/100=0.80\) for the new treatment and \(60/100=0.60\) for usual care. The observed difference is \(0.80-0.60=0.20\), or 20 percentage points. The mean recovery-score difference between assigned groups is \(82-76=6\) points.

Classification. Given the stated timing and causal account, adherence is a mediator because it occurs after assignment, is influenced by assignment, and lies on the proposed route to recovery. These summaries are compatible with that explanation, but the numbers alone do not prove it. In particular, an association between adherence and recovery does not establish the causal arrow \(M \rightarrow Y\); other factors could influence both.

A Short Path-Based Justification

The distinction between a prognostic variable and a confounder follows directly from the diagram. A variable can predict \(Y\) because an arrow reaches \(Y\), while having no causal connection to \(X\). In that case, it does not supply the common-cause path \(X \leftarrow C \rightarrow Y\). By contrast, when the common-cause arrows are present, the path from \(X\) to \(Y\) starts with an arrow into \(X\), so it is a backdoor path.

$$ Z \rightarrow Y,\quad \text{with no path from }Z\text{ into }X \quad\Longrightarrow\quad Z\text{ is prognostic but not a common-cause confounder}; $$
$$ C \rightarrow X,\quad C \rightarrow Y \quad\Longrightarrow\quad X \leftarrow C \rightarrow Y\text{ is a backdoor path}. $$

These statements concern the proposed causal structure, not merely the observed regression output. If the structure is uncertain, classification should be reported as a reasoned hypothesis rather than as a fact established by a coefficient or a p-value.

How to Classify a Candidate Covariate

1
Specify the question.
Name the exposure and outcome. A variable can have different roles for different exposure–outcome pairs.
2
Place the variable in time.
Ask whether it precedes exposure, follows exposure, or represents a process that overlaps either period.
3
State the proposed arrows.
Use subject-matter knowledge to assess whether the variable influences exposure, outcome, or both, or lies between exposure and outcome.
4
Assign the role cautiously.
A common cause may be a confounder; a variable on an exposure-to-outcome path may be a mediator; an outcome predictor alone is prognostic. A variable may have more than one of these descriptions.

Common Mistakes and Why the Distinction Matters

  • “It predicts the outcome, so it is a confounder.” This reasoning considers only the link to \(Y\). A confounder in the common-cause case must also have a causal role in exposure assignment; an outcome predictor alone may be prognostic only.
  • “It was measured before treatment, so it is a confounder.” Prior timing rules out its being a mediator of that treatment, but does not show that it causes or is otherwise connected to treatment. It may be prognostic only, irrelevant to both, or a confounder.
  • “It is associated with treatment, so it causes treatment.” Statistical association does not determine causal direction. A diagram needs evidence and subject-matter justification.
  • “Every covariate has one exclusive label.” A common cause of exposure and outcome can also predict the outcome, so it can be both confounding and prognostic. Labels summarize different features of its role.
  • “A post-exposure variable is always a mediator.” Being measured later does not establish that exposure caused the variable or that the variable affects the outcome. Those arrows need justification.

The practical value of the distinction is that covariate selection is not simply a search for variables with strong outcome associations. A variable’s causal position helps determine what an adjusted association represents. For any proposed adjustment, describe the target exposure–outcome question, explain the relevant arrows, and distinguish observed prediction from causal evidence. This makes regression interpretations more transparent without treating a fitted model as proof of a causal diagram.

Check Your Understanding

For each question, explain the classification using the proposed timing or causal relationships.

  1. A baseline measure causes both the chance of receiving a treatment and the outcome. What role does it play in the treatment–outcome question, and why?
  2. A biomarker predicts the outcome, but a randomized exposure is independent of it and the proposed diagram has no causal path from the biomarker to exposure. Is it a confounder in that diagram?
  3. A treatment affects attendance at follow-up, and attendance is proposed to affect the recorded outcome. What causal role might attendance have, and what evidence would be needed to support that classification?
  4. Can a variable be both prognostic and a confounder? Give the relevant arrows.
  5. Why does a nonzero regression coefficient for a covariate fail to establish that the covariate is a confounder?