Tutorials › Bayesian Clinical Trials › Marginal and Conditional Treatment-Effect Estimands

Bayesian Estimands and Regulatory Interpretation · Tutorial 281 of 696

Marginal and Conditional Treatment-Effect Estimands

Distinguish population-averaged from covariate-specific treatment effects, and calculate each correctly from logistic and linear models.

Advanced 11 min read

What You'll Learn

  • Define marginal and conditional treatment-effect estimands using a target covariate distribution.
  • Standardize logistic-regression predictions to obtain marginal treatment-specific outcome probabilities.
  • Explain why a conditional odds ratio can differ from its marginal counterpart even without confounding.
  • Calculate marginal and conditional effects from a linear regression with treatment–covariate interaction.
  • Transform posterior model draws into a posterior distribution for a marginal estimand.
  • Diagnose target-population, model, and interpretation errors when reporting treatment effects.

Why the Same Trial Can Have Different Treatment Effects

A treatment effect can describe a contrast for patients with specified covariates, or an average contrast for a defined population. These are different estimands, even when they are calculated from the same fitted model. A regression coefficient is not automatically the population-average effect: its meaning depends on the model, the outcome scale, and which covariates are held fixed or averaged over.

This distinction matters in a clinical trial because a conditional result may describe effects for a particular covariate profile, while a marginal result describes an average over the patients represented by a chosen target population. The target population must be stated: changing its covariate distribution can change a marginal effect, particularly when treatment effects vary across covariate values.

Definition: Let \(A\in\{0,1\}\) denote treatment, \(X\) baseline covariates, and \(Y(a)\) the outcome that would be observed under treatment \(a\). Define \(m_a(x)=E\{Y(a)\mid X=x\}\). A conditional treatment effect compares \(m_1(x)\) with \(m_0(x)\) at a specified \(x\), on a stated effect scale. A marginal treatment effect averages the treatment-specific outcomes over a target covariate distribution \(F^*\), then contrasts the averages on a stated scale. For a mean-difference estimand, \(\mu_a^*=\int m_a(x)\,dF^*(x)\) and \(\Delta^*=\mu_1^*-\mu_0^*\).

The treatment strategies, endpoint, handling of intercurrent events, and target population are part of the estimand, not details to be supplied by the regression model after the fact. Here, the focus is the distinction between conditioning and averaging over baseline covariates. A causal interpretation additionally requires a well-defined treatment, consistency between observed outcomes and the corresponding potential outcomes, and exchangeability and positivity for the relevant treatment comparisons. Random assignment supports exchangeability in expectation; positivity means that each treatment being compared is possible for the covariate profiles in the target population.

To calculate a marginal effect from an outcome model, predict each patient’s outcome under each treatment and average those predictions over the target population. This is often called standardization or g-computation. The same individuals or covariate values must be used for both treatment predictions, so the comparison refers to a common target distribution.

Logistic Regression: Conditional and Marginal Effects

For a binary outcome, a logistic regression model specifies the outcome probability conditional on treatment and covariates. With one binary covariate and no treatment interaction, a model can be written \(\operatorname{logit}\{P(Y=1\mid A,X)\}=\beta_0+\beta_A A+\beta_X X\), where \(\operatorname{logit}(p)=\log\{p/(1-p)\}\). In this model, \(\beta_A\) is a conditional log odds ratio: at a fixed value of \(X\), the treatment odds ratio is \(\exp(\beta_A)\). It is not, in general, the log odds ratio obtained after averaging the outcome probabilities over \(X\).

The marginal probabilities are computed on the probability scale first: \(\mu_a^*=\int P(Y=1\mid A=a,X=x)\,dF^*(x)\). A marginal odds ratio, if that is the chosen contrast, is then formed from these two averaged probabilities. Averaging probabilities and then converting to odds is not the same operation as averaging or retaining conditional odds.

Worked Example: Standardizing a Logistic Model

Suppose a hypothetical randomized trial has a binary baseline covariate \(X\), with 60% of the target population at \(X=0\) and 40% at \(X=1\). Assume the fitted model is \(\operatorname{logit}\{P(Y=1\mid A,X)\}=-2+(\log 2)A+(\log 3)X\). The outcome is an undesirable event, and the model has no treatment-by-\(X\) interaction. Calculate the target-population probabilities under each treatment and compare the conditional and marginal odds ratios.

Under control, the probabilities at \(X=0\) and \(X=1\) are \(\operatorname{expit}(-2)=1/(1+e^2)\approx0.1192\) and \(\operatorname{expit}(-2+\log 3)=3/(e^2+3)\approx0.2888\). Under treatment, they are \(\operatorname{expit}(-2+\log 2)=2/(e^2+2)\approx0.2130\) and \(\operatorname{expit}(-2+\log 2+\log 3)=6/(e^2+6)\approx0.4481\). The model’s assumptions here are that these conditional probabilities follow the stated logistic form and that the target proportions are 0.6 and 0.4.

Standardize separately under each treatment, using the same target weights:

$$ \begin{aligned} \widehat{\mu}_0^* &=0.6\left\{\frac{1}{1+e^2}\right\} +0.4\left\{\frac{3}{e^2+3}\right\} \approx 0.187028,\\ \widehat{\mu}_1^* &=0.6\left\{\frac{2}{e^2+2}\right\} +0.4\left\{\frac{6}{e^2+6}\right\} \approx 0.307059. \end{aligned} $$

The fitted conditional odds ratio is \(\exp(\beta_A)=2\) at either value of \(X\). The odds ratio formed from the standardized probabilities is instead \(\{0.307059/(1-0.307059)\}/\{0.187028/(1-0.187028)\}\approx1.926\). This difference is not evidence of confounding: in this hypothetical randomized setting, \(X\) is prognostic, the conditional treatment odds ratio is constant, and odds ratios are non-collapsible. The nonlinear conversion from probability to odds means a conditional odds ratio need not equal the marginal odds ratio.

The short derivation is that the conditional model first maps each linear predictor through the expit function, then standardization averages those probabilities. In general, for covariate values \(x\) with weights \(w_x\), \(\sum_x w_x\operatorname{expit}(\beta_0+\beta_A a+\beta_X x)\) does not equal \(\operatorname{expit}\{\beta_0+\beta_A a+\beta_X\sum_x w_xx\}\). Nor does taking the odds of the averaged probability reproduce the conditional odds ratio. The calculation must therefore follow the estimand’s order of operations: predict, average over \(F^*\), and only then apply a contrast defined on the desired scale.

Linear Regression: Interaction and Averaging

For a continuous outcome, consider a linear conditional-mean model with a binary covariate: \(E(Y\mid A,X)=\beta_0+\beta_A A+\beta_X X+\beta_{AX}AX\). At \(X=x\), the conditional mean difference for treatment versus control is \(\beta_A+\beta_{AX}x\). Averaging over a target population with mean covariate value \(E_{F^*}(X)\) gives a marginal mean difference of \(\beta_A+\beta_{AX}E_{F^*}(X)\). Thus, when the interaction is nonzero, the marginal effect depends on the target covariate distribution.

Worked Example: A Linear Model With Effect Modification

In a hypothetical trial, let \(Y\) be a symptom score in points, with lower scores preferable, and \(X=1\) indicate a baseline risk group. Suppose 60% of the target population has \(X=0\) and 40% has \(X=1\). A fitted model is \(E(Y\mid A,X)=10-2A+3X-AX\). Assume this linear model correctly describes the conditional means and the target proportions are known for this calculation.

Under control, the predicted means are 10 points for \(X=0\) and \(10+3=13\) points for \(X=1\). Under treatment, they are \(10-2=8\) points for \(X=0\) and \(10-2+3-1=10\) points for \(X=1\). Therefore the conditional treatment effects are \(8-10=-2\) points at \(X=0\) and \(10-13=-3\) points at \(X=1\).

The standardized means are

$$ \begin{aligned} \widehat{\mu}_0^*&=0.6(10)+0.4(13)=11.2\text{ points},\\ \widehat{\mu}_1^*&=0.6(8)+0.4(10)=8.8\text{ points},\\ \widehat{\Delta}^*&=8.8-11.2=-2.4\text{ points}. \end{aligned} $$

The marginal estimate is the target-population average of the two conditional mean differences: \(0.6(-2)+0.4(-3)=-2.4\) points. In context, the model estimates a 2.4-point lower mean symptom score under treatment for this target population. It does not say that every patient’s score decreases by 2.4 points.

In the special additive linear model with no treatment-by-covariate interaction, the conditional mean difference is the same at every \(x\), namely \(\beta_A\). Averaging a constant over any target distribution leaves it unchanged, so the marginal and conditional mean differences coincide. This equality depends on the outcome scale and model structure; it should not be assumed for a nonlinear model such as logistic regression.

Worked Example: Changing the Target Population

Keep the conditional means from the preceding example, but suppose the target population is 90% \(X=0\) and 10% \(X=1\). The conditional predictions are unchanged; only the population being averaged over has changed. Under control, the target mean is \(0.9(10)+0.1(13)=10.3\) points. Under treatment, it is \(0.9(8)+0.1(10)=8.2\) points. The marginal mean difference is \(8.2-10.3=-2.1\) points, also \(0.9(-2)+0.1(-3)=-2.1\) points. This differs from the \(-2.4\)-point effect for the 60%/40% target population because the conditional effects differ across the two covariate groups.

Bayesian Standardization and Practical Checks

In a Bayesian analysis, the model parameters are uncertain, so the standardized estimand is uncertain as well. For each posterior draw of the model parameters, calculate the predicted outcome under each treatment for every target covariate profile, average those predictions using the target-population weights, and then form the specified contrast. The resulting collection of draw-specific estimands represents the posterior distribution of the marginal effect. Do not substitute posterior mean coefficients into a nonlinear prediction formula and treat the result as the posterior mean estimand: in general, transforming posterior means is not equivalent to averaging transformed posterior draws.

Worked Example: Standardizing Posterior Draws

Suppose a hypothetical Bayesian analysis supplies two equally weighted posterior draws of predicted event probabilities for two baseline groups. The target population is 70% group 1 and 30% group 2. In draw 1, treatment probabilities are 0.20 and 0.40, and control probabilities are 0.10 and 0.25. In draw 2, the corresponding treatment probabilities are 0.24 and 0.45, and control probabilities are 0.12 and 0.30. For each draw, calculate the marginal probabilities and their difference.

For draw 1, the standardized treatment probability is \(0.7(0.20)+0.3(0.40)=0.26\), and the standardized control probability is \(0.7(0.10)+0.3(0.25)=0.145\). The draw-specific marginal difference is \(0.26-0.145=0.115\). For draw 2, the corresponding probabilities are \(0.7(0.24)+0.3(0.45)=0.303\) and \(0.7(0.12)+0.3(0.30)=0.174\), giving a difference of \(0.303-0.174=0.129\). The mean of these two equally weighted draw-specific differences is \((0.115+0.129)/2=0.122\). In a real analysis, many posterior draws would be used; these two hypothetical draws illustrate the calculation, not a reliable posterior summary.

Useful diagnostics include checking that target-population weights sum to one, that both treatment predictions use the same covariate profiles, and that predicted outcomes are plausible for those profiles. Examine overlap or positivity: if the target includes covariate patterns with little or no information under one treatment, model-based predictions there depend heavily on extrapolation. Check model fit and functional form, including treatment-by-covariate interactions when scientifically plausible. A model that fits average outcomes but misses important subgroup patterns can produce a misleading standardized estimate.

Standardization is not the only way to estimate a marginal effect. A conditional regression coefficient answers a covariate-specific model question; standardization answers a population-average question by averaging model predictions. Weighting approaches can also target marginal contrasts, but require appropriate weights and their own diagnostics. These approaches should not be treated as interchangeable merely because they use the same trial data. The estimand, target distribution, model assumptions, and effect scale determine what each result means.

A frequent mistake is to report the treatment coefficient from a logistic regression as the population-average treatment effect. That coefficient is a conditional log odds ratio under the specified model; it is not generally a marginal contrast. The correction is to state the target distribution, predict under each treatment for its covariate profiles, average the predictions, and calculate the contrast on the prespecified scale. Another mistake is to average covariates first and predict for an “average patient.” For nonlinear outcome models, that prediction generally differs from averaging predictions across the actual target covariate distribution.

Key takeaway: Conditional effects hold covariates fixed; marginal effects average treatment-specific outcomes over a stated target population. Their numerical values can differ because of effect modification, nonlinear outcome scales, or a change in target-population composition.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. In a logistic model with a treatment coefficient \(\beta_A\), what does \(\exp(\beta_A)\) represent when there is no treatment-by-covariate interaction?
  2. Why can a marginal odds ratio differ from a conditional odds ratio even when treatment is randomized and the conditional odds ratio is constant?
  3. In a linear model with a treatment-by-covariate interaction, what determines the marginal mean difference?
  4. What is the correct order of operations for obtaining a standardized marginal effect from each Bayesian posterior draw?
  5. Name two checks that can reveal when a model-based marginal estimate is unreliable.

Solutions. (1) It is the treatment odds ratio conditional on the covariates included in the model. (2) Odds are a nonlinear transformation of probabilities: averaging predicted probabilities and then forming odds does not generally preserve the conditional odds ratio. (3) It is the average of the conditional mean differences over the target covariate distribution, so it depends on that distribution when effects vary by covariate. (4) Predict outcomes under both treatments for the target covariate profiles, average each set of predictions using the target weights, and then form the stated contrast. (5) Examples include checking overlap or positivity, assessing outcome-model fit and functional form, verifying that the target weights sum to one, and checking that treatment predictions use the same target profiles.

Clinical Biostats