Why Let Treatment Effects Vary Across Subgroups?
In a basket trial, a treatment may be evaluated in several disease subgroups. Subgroups can differ in their untreated response rates, in how strongly the treatment works, or in both. A model that allows only baseline risks to differ captures the first kind of variation, but assumes a common treatment effect on its chosen model scale. A random treatment slope allows the treatment effect itself to vary across subgroups, while still relating those effects through a shared distribution.
The distinction is especially important for binary outcomes. On the logistic scale, subgroup baseline risk is represented by an intercept, whereas the conditional treatment effect is represented by a treatment coefficient. A random intercept alone allows different baseline log odds; it does not create subgroup-specific conditional odds ratios.
A Logistic Model With Random Intercepts and Slopes
Index subgroups by \(j=1,\ldots,J\) and patients within subgroup \(j\) by \(i\). Let \(Y_{ij}\) equal 1 for a patient with the specified binary outcome and 0 otherwise. Let \(T_{ij}=1\) indicate treatment and \(T_{ij}=0\) indicate control. The logistic model is
Here \(\operatorname{logit}(p)=\log\{p/(1-p)\}\). The parameter \(\alpha\) is the population-average intercept on the log-odds scale, and \(\beta\) is the population-average treatment coefficient. The subgroup deviations \(u_j\) and \(v_j\) are, respectively, the random intercept and random treatment slope. Thus, subgroup \(j\)’s intercept is \(\alpha+u_j\), and its treatment coefficient is \(\beta+v_j\).
A common exchangeable specification is
The zero means define \(\alpha\) and \(\beta\) as the centers of the subgroup intercept and treatment-coefficient distributions. The variance parameters describe between-subgroup dispersion, and \(\rho\) allows baseline and treatment-effect deviations to be associated. The distribution expresses an exchangeability assumption: before observing subgroup-specific outcomes, the subgroup effects are treated as draws from a shared distribution. It does not assert that the subgroups are clinically identical.
The model also requires a suitable outcome likelihood and treatment allocation. Conditional on the subgroup effects and model parameters, patient outcomes are assumed independent Bernoulli observations with the stated probabilities. For grouped counts, this gives a binomial likelihood within each subgroup and treatment arm. In a randomized basket trial, treatment and control comparisons within a subgroup can support subgroup-specific effects, subject to the usual requirements of valid randomization, outcome measurement, and adequate data. A subgroup containing only treated or only control patients generally cannot, by itself, separate its baseline level from its treatment effect.
A complete Bayesian model additionally assigns prior distributions to \(\alpha\), \(\beta\), and the between-subgroup parameters. Those priors must be proper or otherwise justified for the intended analysis. The specific choice affects inference, especially when data are sparse; it is not determined by the likelihood alone.
The Treatment Contrast Shows What the Slope Means
For a patient in subgroup \(j\), the control linear predictor is \(\alpha+u_j\). The treated linear predictor is \(\alpha+u_j+\beta+v_j\). Their difference is
Because the difference in linear predictors is the log odds ratio, the subgroup-specific conditional odds ratio is \(\exp(\beta+v_j)\). The random intercept cancels. This is the key distinction: \(u_j\) changes both arms’ baseline log odds in subgroup \(j\), whereas \(v_j\) changes the treatment-control contrast.
This is a conditional odds ratio, conditional on subgroup and on the model’s included terms. It is not a risk difference, and it is not generally a marginal odds ratio averaged over subgroups. Even when \(v_j=0\) for every subgroup, different baseline risks can produce different treatment risk differences. Conversely, different \(v_j\) values imply different conditional odds ratios.
Worked Example: Calculating Subgroup Probabilities From Both Random Effects
Suppose a hypothetical two-subgroup model has \(\alpha=-2.0\) and \(\beta=0.7\). Let subgroup A have \(u_A=0.4\), \(v_A=0.3\), and subgroup B have \(u_B=-0.5\), \(v_B=-0.2\). Calculate each subgroup’s control and treatment response probabilities and conditional odds ratio.
For subgroup A, the control log odds are \(-2.0+0.4=-1.6\), so its control probability is \(1/(1+\exp(1.6))=0.1680\). Its treatment coefficient is \(0.7+0.3=1.0\), so treated log odds are \(-1.6+1.0=-0.6\). The treated probability is \(1/(1+\exp(0.6))=0.3543\), and the conditional odds ratio is \(\exp(1.0)=2.718\).
For subgroup B, the control log odds are \(-2.0-0.5=-2.5\), giving probability \(1/(1+\exp(2.5))=0.07586\). Its treatment coefficient is \(0.7-0.2=0.5\); treated log odds are \(-2.5+0.5=-2.0\), giving probability \(1/(1+\exp(2.0))=0.1192\). Its conditional odds ratio is \(\exp(0.5)=1.649\).
The intercept deviations account for different control probabilities. The slope deviations account for different conditional odds ratios. Both types of variation appear in this example.
Why the Random Intercept Does Not Replace a Random Slope
The distinction follows directly from the model’s treatment contrast. Consider the random-intercept-only model, which sets \(v_j=0\). The log odds ratio in every subgroup is then \(\beta\), no matter how much the \(u_j\) values differ. Thus, a random intercept can accommodate baseline heterogeneity but cannot represent variation in conditional treatment odds ratios.
The converse also matters. A model with a random slope but no subgroup-specific intercept imposes a common baseline log odds across subgroups. If baseline risks differ and this restriction is false, the model may misrepresent the control outcomes, even if the treatment effects vary. Including both terms allows baseline and treatment contrasts to vary separately, and allowing their random effects to be correlated recognizes that the two kinds of subgroup deviation may be associated.
Control: \(\alpha+u_j\). Treatment: \(\alpha+u_j+\beta+v_j\).
The intercept and random intercept cancel, leaving \(\beta+v_j\).
Exponentiating the log odds contrast gives subgroup \(j\)’s conditional odds ratio, \(\exp(\beta+v_j)\).
Worked Example: Different Baseline Risks With a Common Treatment Effect
Suppose a hypothetical treatment has a common conditional odds ratio of 2 in two subgroups. The control response probability is 0.10 in subgroup A and 0.50 in subgroup B. Find the treatment response probability in each subgroup, then determine whether the differences in risk imply different treatment odds ratios.
For subgroup A, control odds are \(0.10/(1-0.10)=0.1111\). Multiplying by the odds ratio gives treatment odds \(0.1111\times2=0.2222\). Converting odds to probability gives \(0.2222/(1+0.2222)=0.1818\). Its risk difference is \(0.1818-0.10=0.0818\).
For subgroup B, control odds are \(0.50/(1-0.50)=1\). Treatment odds are \(1\times2=2\), giving treatment probability \(2/(1+2)=0.6667\). Its risk difference is \(0.6667-0.50=0.1667\).
The risk differences differ, but the treatment odds ratio is 2 in both subgroups. This pattern is compatible with a random-intercept model and a common treatment slope; it does not, by itself, demonstrate random treatment slopes.
Worked Subgroup Contrasts and Their Limits
Observed treatment-control contrasts can suggest whether a common slope is plausible, but raw subgroup estimates are noisy, particularly with small basket sizes. A hierarchical model estimates subgroup effects jointly and partially pools them through the shared distribution. The calculations below are descriptive contrasts, not fitted posterior estimates.
Worked Example: Comparing Crude Odds Ratios Across Two Subgroups
In hypothetical subgroup 1, 5 of 25 control patients and 12 of 25 treated patients respond. In hypothetical subgroup 2, 10 of 25 control patients and 12 of 25 treated patients respond. Calculate the observed odds ratios and log odds ratios.
In subgroup 1, control nonresponses number \(25-5=20\), and treated nonresponses number \(25-12=13\). Thus \(\widehat{\mathrm{OR}}_1=(12/13)/(5/20)=(12\times20)/(13\times5)=3.692\), and \(\log(\widehat{\mathrm{OR}}_1)=1.306\).
In subgroup 2, control nonresponses number \(25-10=15\), while treated nonresponses remain 13. Thus \(\widehat{\mathrm{OR}}_2=(12/13)/(10/15)=(12\times15)/(13\times10)=1.385\), and \(\log(\widehat{\mathrm{OR}}_2)=0.3254\).
The observed contrasts differ, which motivates examining treatment-effect heterogeneity. They do not establish that the underlying subgroup effects differ: sampling variation may produce different estimates even under a common effect. The multilevel model uses the likelihood together with the subgroup distribution and priors to estimate the effects; these crude calculations alone are not a posterior analysis.
Alternatives, Diagnostics, and Limitations
| Model or approach | Subgroup baseline risks | Conditional treatment effects | Typical implication |
|---|---|---|---|
| Common logistic treatment effect, no random intercept | Constrained to a common intercept | Common | Strong pooling of both baseline and treatment effects |
| Random intercept, common treatment slope | Vary | Common | Allows prognostic variation but not treatment-effect variation |
| Random intercept and random treatment slope | Vary | Vary through a shared distribution | Partial pooling of both types of subgroup effects |
| Separate subgroup analyses | Vary | Vary independently | No cross-subgroup borrowing; estimates can be unstable with sparse data |
A treatment-by-subgroup interaction with fixed subgroup-specific coefficients is another alternative. It estimates distinct effects without treating them as draws from a common distribution. This may be useful when the subgroup set is small and specific comparisons are the focus, but it does not provide the same hierarchical partial pooling assumption.
Several checks are important before interpreting random slopes. First, verify treatment overlap within each subgroup: if treatment is completely confounded with subgroup, within-subgroup treatment contrasts cannot be distinguished from baseline differences. Second, examine whether the outcome and allocation information are adequate for estimating the additional variation; sparse or extreme binary outcomes can leave subgroup effects weakly identified. Third, inspect posterior summaries and uncertainty for subgroup intercepts, slopes, and predictions, alongside convergence diagnostics and model-based predictive checks. In particular, check whether replicated data reproduce response patterns across both treatment arms and subgroups.
A random-slope model is not automatically preferable because its estimates can differ by subgroup. It adds structure and parameters, and its conclusions depend on the exchangeability and prior assumptions. With few subgroups, the between-subgroup slope variation may be difficult to estimate. With little treatment overlap, the data may not distinguish \(u_j\) from \(v_j\) reliably. Sensitivity to reasonable prior choices and to the random-effects structure should therefore be considered.
Common Mistake
- Wrong reasoning: “The subgroups have different control response rates, so the treatment effect must vary.”
- Correction: Different control rates indicate baseline variation, which a random intercept can represent. To claim variation in conditional treatment effects, compare treatment-control contrasts on the model scale; in this logistic model, those are the subgroup log odds ratios \(\beta+v_j\).
- Another wrong inference: “The treatment risk differences differ, so the conditional odds ratios must differ.”
- Correction: A common odds ratio can yield different risk differences at different baseline risks, as the worked calculation showed. State the effect scale before interpreting heterogeneity.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- In the stated model, what is subgroup \(j\)’s conditional treatment odds ratio?
- If all \(v_j=0\), can control response probabilities still differ across subgroups? Explain.
- Why is a subgroup with only treated patients generally insufficient to identify its own baseline intercept and treatment slope separately?
- Could different subgroup risk differences occur when conditional treatment odds ratios are identical? Give the reason.
Solutions. (1) It is \(\exp(\beta+v_j)\), because \(\beta+v_j\) is the treated-minus-control difference in log odds. (2) Yes. Different \(u_j\) values change the control log odds \(\alpha+u_j\) even when every treatment slope is \(\beta\). (3) Without a control group in that subgroup, its observed treated outcome level combines baseline log odds and treatment effect; the two components are not separated by a within-subgroup contrast. (4) Yes. The same odds ratio acts on different baseline odds, producing different treated probabilities and potentially different risk differences.