Tutorials › Bayesian Clinical Trials › Treatment-Effect Heterogeneity And Trial Performance

Calibrating Operating Characteristics · Tutorial 218 of 696

Treatment-Effect Heterogeneity And Trial Performance

See how treatment effects that vary across patient groups can change subgroup decisions and overall trial performance, even when the average effect is similar.

Advanced 12 min read

What You'll Learn

  • Define subgroup-specific and target-population-average treatment effects on the risk-difference scale.
  • Set up a simulation that varies treatment effects across patient groups while keeping the analysis rule fixed.
  • Estimate overall and subgroup decision probabilities from simulated trials.
  • Quantify Monte Carlo error in estimated decision probabilities.
  • Diagnose errors caused by mismatched population weights, effect scales, or simulation and analysis models.
  • Compare pooled and group-standardized analyses for heterogeneous effects.

Why treatment-effect heterogeneity matters

A trial can have a positive average treatment effect while effects differ substantially among patient groups. For example, a treatment might improve response in one group and have little effect in another. The trial's overall decision probability then answers a different question from the decision probability within either group. Both depend on the trial design, the target population, and the exact analysis rule.

Operating-characteristic simulation makes this distinction explicit. Specify how outcomes vary by treatment and group, simulate trials under those conditions, apply the same prespecified Bayesian analysis to every trial, and record how often each decision is made. The resulting frequencies describe the performance of that design-and-analysis combination under the simulated scenarios; they are not properties of the treatment alone.

Definition: For patient group \(g\), let \(p_{Tg}\) and \(p_{Cg}\) denote the response probabilities under treatment and control. On the risk-difference scale, the group-specific treatment effect is \(\Delta_g=p_{Tg}-p_{Cg}\). For a target population with group proportions \(w_g\), where \(w_g\geq 0\) and \(\sum_g w_g=1\), the target-population-average effect is \(\Delta_{\mathrm{target}}=\sum_g w_g\Delta_g\). Heterogeneity means that the treatment effects differ across groups on the chosen effect scale.

The scale matters: effects that differ on the risk-difference scale need not differ in the same way on a relative-risk or odds-ratio scale. Here, examples use binary responses and risk differences. Assume that each participant contributes one outcome, that outcomes are independent conditional on treatment and group, and that the specified response probabilities adequately describe the data-generating scenario. Group membership is recorded before treatment, and treatment assignment within groups follows the simulated design. These assumptions simplify the examples; an actual simulation should reproduce relevant features such as clustering, missing outcomes, or unequal allocation when those features are part of the trial.

Fix the estimand and the decision rule

Before simulating, specify the target weights \(w_g\). They describe the population to which the overall effect refers; they are not automatically the proportions enrolled in a trial. Then state the analysis and decision rule precisely. For example, an analysis might estimate each \(\Delta_g\), combine posterior draws using the target weights, and declare overall success when the posterior probability that \(\Delta_{\mathrm{target}}\) exceeds a clinically meaningful threshold is greater than 0.95. A subgroup rule might separately declare a group-specific benefit when the posterior probability that \(\Delta_g>0\) exceeds 0.95.

Those are distinct decisions. A positive subgroup decision does not itself imply overall success, and an overall decision does not imply benefit in every subgroup. The rule must be fixed before comparing scenarios: changing the threshold, prior, model, or estimand between scenarios makes the performance comparison difficult to interpret.

For a binary-outcome example, one possible analysis assigns independent \(\mathrm{Beta}(1,1)\) priors to each treatment-by-group response probability. If \(y_{ag}\) responses are observed among \(n_{ag}\) participants in treatment arm \(a\) and group \(g\), the posterior for that response probability is \(\mathrm{Beta}(1+y_{ag},1+n_{ag}-y_{ag})\). Posterior draws of the arm-specific probabilities give draws of \(\Delta_g\); weighted sums of those draws give draws of \(\Delta_{\mathrm{target}}\). This specifies an analysis for illustration, not a universal recommendation.

Simulation logic and a useful justification

Let \(D_r\) be the simulated data from replicate trial \(r\), and let \(I_r\) equal 1 when the fixed decision rule is met in that replicate and 0 otherwise. Across \(R\) independently simulated trials, the estimated decision probability is the fraction of replicates meeting the rule. The same calculation applies separately to overall and subgroup decisions.

$$ \widehat{\pi}=\frac{1}{R}\sum_{r=1}^{R} I_r $$

This frequency estimates the probability of the decision under the scenario and the specified design and analysis. Since \(I_r\) is Bernoulli with success probability \(\pi\), the Monte Carlo standard error of the estimated probability is approximately \(\sqrt{\widehat{\pi}(1-\widehat{\pi})/R}\). Increasing \(R\) reduces simulation error; it does not correct a poorly specified scenario or an unsuitable analysis model.

The weighted estimand also has a direct justification. In each group, the population response probability under treatment is \(p_{Tg}\), so the target population's response probability under treatment is \(\sum_g w_gp_{Tg}\). Under control it is \(\sum_g w_gp_{Cg}\). Subtracting gives:

$$ \sum_g w_gp_{Tg}-\sum_g w_gp_{Cg} =\sum_g w_g(p_{Tg}-p_{Cg}) =\sum_g w_g\Delta_g $$

This identity shows why target weights belong in the overall estimand. It also shows why an unweighted average of subgroup effects is correct only when the target groups have equal weights.

1
Specify the scenario.
Set group proportions, treatment and control response probabilities by group, allocation, sample size, and any other data-generating features included in the trial.
2
Generate a replicate trial.
Draw outcomes under the scenario and the planned allocation, preserving the group structure needed by the analysis.
3
Apply the fixed analysis.
Fit the prespecified model, calculate posterior probabilities for the overall and subgroup estimands, and apply the decision thresholds without tuning them to the simulated results.
4
Repeat and summarize.
Repeat for \(R\) trials, then report each decision frequency and its Monte Carlo uncertainty, with the scenario and rule identified.

Worked Example: A Benefit in One Group and No Effect in Another

Hypothetical scenario. There are two equally weighted groups, A and B. Each simulated trial has 50 treatment and 50 control participants in each group. Control response probability is 0.30 in both groups; treatment response probabilities are 0.50 in A and 0.30 in B. Thus \(\Delta_A=0.20\), \(\Delta_B=0\), and the overall target effect is \(0.5(0.20)+0.5(0)=0.10\).

Use the group-specific Beta model described above. In every replicate, the overall decision is positive when the posterior probability that the equally weighted effect exceeds zero is greater than 0.95. Each subgroup decision is positive when that group's posterior probability of a positive risk difference exceeds 0.95. Suppose 20,000 hypothetical replicates yield 8,760 overall decisions, 13,080 positive decisions for A, and 1,020 for B.

The estimated overall decision probability is \(8{,}760/20{,}000=0.438\), or 43.8%. For group A it is \(13{,}080/20{,}000=0.654\), or 65.4%; for group B it is \(1{,}020/20{,}000=0.0510\), or 5.10%. For the overall estimate, the Monte Carlo standard error is approximately \(\sqrt{0.438(1-0.438)/20{,}000}=0.00351\), or 0.351 percentage points. The corresponding estimates for A and B also have simulation error; none is an exact probability.

The pattern is consistent with the scenario: the overall effect averages a substantial benefit in A with no effect in B, while the subgroup rules target different effects. A low subgroup decision probability in B does not establish harm; the simulated true effect there is zero, and the rule is designed to make positive decisions infrequently in that case.

Worked Example: Same Average Effect, Different Effect Patterns

Hypothetical comparison. Keep two equally weighted groups, 50 participants per arm per group, and control response probability 0.30 in both. Compare a homogeneous scenario with treatment response probability 0.40 in both groups to a heterogeneous scenario with probabilities 0.50 in A and 0.30 in B. In both scenarios the target-average risk difference is 0.10: \(0.5(0.10)+0.5(0.10)=0.10\) in the first and \(0.5(0.20)+0.5(0)=0.10\) in the second.

Apply the same group-specific model and decision rules in both scenarios, using 20,000 hypothetical replicates per scenario. Suppose the overall decisions occur in 8,620 replicates under homogeneity and 8,760 under heterogeneity. The estimated overall probabilities are \(8{,}620/20{,}000=0.431\) and \(8{,}760/20{,}000=0.438\). Suppose the subgroup decision frequencies are 0.279 in each group under homogeneity, and 0.654 in A and 0.0510 in B under heterogeneity.

The overall probabilities are similar because the target-average effects and designs are similar, but they need not be identical: the group-specific outcome distributions, and therefore the posterior uncertainty in the weighted effect, differ. The subgroup probabilities reveal a marked contrast that the overall probability alone cannot show. The simulation answers a performance question under each specified scenario; it does not imply that two scenarios with the same average effect must have identical operating characteristics.

Worked Example: Trial Composition Is Not the Target Population

Hypothetical scenario. The target population is 80% group A and 20% group B. In A, control and treatment response probabilities are 0.20 and 0.40, giving \(\Delta_A=0.20\). In B, they are 0.60 and 0.50, giving \(\Delta_B=-0.10\). The target-average effect is \(0.80(0.20)+0.20(-0.10)=0.14\), or a 14-percentage-point increase in response.

Suppose the trial instead enrolls equal numbers from the two groups, with 100 participants per arm in each group. The unweighted average of the two effects is \((0.20-0.10)/2=0.050\), or 5 percentage points. That quantity describes an equally weighted mix of trial groups, not the stated target population. A fixed analysis that targets the 80%/20% population should combine group-specific posterior draws using 0.80 and 0.20.

For illustration, set the overall decision rule to require posterior probability greater than 0.95 that the target effect exceeds 0.10. Suppose 20,000 hypothetical replicates under the 80%/20% weighted analysis produce 3,640 decisions. The estimated decision probability is \(3{,}640/20{,}000=0.182\), or 18.2%. The mean target effect of 0.14 is above the threshold, but that fact alone does not guarantee a high decision probability: sampling variability and the demanding posterior-probability rule both matter. This example also shows why the analysis weights and target population must be stated alongside the operating characteristic.

Diagnostics, alternatives, and limitations

Useful checks begin with the scenario definitions. Confirm that group proportions sum to one, each response probability is between zero and one, and the stated overall effect equals the weighted subgroup effects. Check that simulated group counts follow the intended allocation and that the analysis uses the intended target weights. If the analysis pools groups while the estimand is target-standardized, the resulting decision may answer a different question.

Compare simulated group-specific response rates and effect estimates with their generating values, especially in a small batch of replicates. Check that decision indicators are computed from the posterior probability specified by the rule, not from whether a point estimate has the desired sign. Repeat the simulation with a larger \(R\) when Monte Carlo standard errors are too large for the intended comparison. If results are unexpectedly identical across scenarios, verify that the varying subgroup effects actually enter the data generator and that the analysis retains group labels.

A pooled analysis can be attractive when the scientific target is a common effect and pooling is defensible, but it may obscure variation when effects differ. A group-specific analysis followed by target weighting makes the overall target explicit and also provides subgroup decisions, but subgroup estimates may be imprecise, particularly in small groups. A hierarchical model can partially pool subgroup effects, but its assumptions and prior influence should be included in the fixed analysis being evaluated. These approaches answer related but not interchangeable questions.

Simulation findings are conditional on the scenarios, model, prior, design, and decision thresholds examined. A finite set of scenarios cannot establish performance under every possible pattern of heterogeneity. Further, subgroup membership can be defined in many ways, and a result on one effect scale may not carry over to another. Report the effect scale, group definitions, target weights, design, analysis, decision rule, replicate count, and Monte Carlo uncertainty so readers can see what the estimated probabilities mean.

  • Confusing the trial mix with the target mix. Using trial enrollment proportions as weights without justification can change the overall estimand.
  • Reporting only the overall decision probability. Similar overall performance can conceal very different subgroup decision probabilities.
  • Treating a simulated frequency as exact. The frequency has Monte Carlo error, and it is conditional on the scenario and the specified analysis.
  • Changing the rule across scenarios. This confounds the effect of heterogeneity with the effect of changing the analysis.
Key takeaway: To assess heterogeneous treatment effects, define group-specific effects and target weights, generate trials with those effects, and apply one fixed analysis and decision rule. Report overall and subgroup decision probabilities separately, with their estimands and Monte Carlo uncertainty.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. Two groups have equal target weights and risk differences 0.12 and 0.04. What is the target-average risk difference?
  2. A simulation makes 2,400 positive decisions in 10,000 replicates. Calculate the estimated decision probability and its approximate Monte Carlo standard error.
  3. Why can equal target-average effects in two scenarios lead to different subgroup decision probabilities?
  4. A trial enrolls 70% of participants from group A, but the target population is 40% A and 60% B. Which weights define the target-average estimand?
  5. What is wrong with concluding that a group has a harmful treatment effect merely because its simulated probability of a positive decision is low?

Solutions. (1) The weighted effect is \(0.5(0.12)+0.5(0.04)=0.080\), an 8-percentage-point increase. (2) The estimate is \(2{,}400/10{,}000=0.240\). Its approximate Monte Carlo standard error is \(\sqrt{0.240(0.760)/10{,}000}=0.00427\), or 0.427 percentage points. (3) Subgroup decision rules depend on subgroup effects and uncertainty, not only on their weighted average; the distribution of effects across groups can change subgroup probabilities. (4) Use target weights 0.40 and 0.60, unless the scientific target is explicitly redefined as the enrolled mix. (5) A low probability of a positive decision is not evidence by itself of harm. It can arise when the true effect is zero, when evidence is imprecise, or because the rule requires strong posterior evidence; harm requires evaluating the probability or evidence for a negative effect under a specified rule.

Clinical Biostats