Tutorials › Bayesian Clinical Trials › Continuous Outcomes In Operating-Characteristic Simulations

Calibrating Operating Characteristics · Tutorial 206 of 696

Continuous Outcomes In Operating-Characteristic Simulations

Build and check operating-characteristic simulations for continuous outcomes, from generating trial data to interpreting decision rates and estimator performance.

Advanced 12 min read

What You'll Learn

  • Specify normal outcome distributions and treatment effects for a simulated trial.
  • Compute a Bayesian posterior and apply a posterior-probability decision rule.
  • Estimate false-positive rates and power from repeated simulated trials.
  • Quantify Monte Carlo uncertainty in estimated decision rates.
  • Evaluate estimator bias, variance, and root mean squared error.
  • Diagnose common simulation and interpretation errors.

Why Simulate Continuous Outcomes?

A trial’s operating characteristics depend on both its decision rule and the outcomes that the trial could produce. For a continuous endpoint, the simulated data must reflect the assumed treatment and control means, outcome variances, sample sizes, and treatment effect. Repeating the trial many times under a specified scenario shows how often the decision rule would declare benefit and how the chosen estimator would perform.

The aim is not to simulate one plausible data set and treat it as representative. It is to estimate repeated-trial quantities under stated assumptions. A decision rate is a probability over hypothetical repetitions of the entire trial; an estimate from a finite simulation has Monte Carlo error.

Definition: An operating-characteristic simulation for a continuous outcome repeatedly generates trial data under specified outcome distributions, applies a prespecified analysis and decision rule to every replicate, and summarizes the resulting decisions or estimates. A scenario is the full set of data-generating conditions, including arm means, variances, and sample sizes.

Specify the Data-Generating and Analysis Models

Consider a two-arm parallel trial with \(n_T\) participants assigned to treatment and \(n_C\) assigned to control. Let \(Y_{Ti}\) and \(Y_{Cj}\) be the continuous outcomes. For a basic simulation, suppose outcomes are independent within and between arms and normally distributed:

$$ Y_{Ti}\sim N(\mu_T,\sigma_T^2), \qquad Y_{Cj}\sim N(\mu_C,\sigma_C^2), \qquad \delta=\mu_T-\mu_C. $$

Here \(\delta\) is the treatment-minus-control effect in the outcome’s units; positive values indicate a higher mean in the treatment arm and favor treatment only when higher outcomes are beneficial. For outcomes where lower values are better, reverse the sign convention or define benefit using \(\delta<0\). The normal distributions and independence assumption must be reasonable for the intended setting. The simple setup also assumes complete outcome measurement, fixed sample sizes, and no additional clustering or covariate adjustment. Those conditions are design choices, not consequences of simulation.

A convenient replicate-level summary is the difference in sample means, \(D=\bar{Y}_T-\bar{Y}_C\). Under the model above,

$$ D\sim N(\delta,V), \qquad V=\frac{\sigma_T^2}{n_T}+\frac{\sigma_C^2}{n_C}. $$

Thus one can simulate all individual outcomes and calculate \(D\), or draw \(D\) directly from this distribution when the analysis depends only on the difference in means and the model assumptions apply. Direct simulation is faster; simulating individual outcomes also allows checks of data-generation code and analyses that use more than the arm means.

To illustrate a Bayesian decision rule, suppose the analysis uses the sampling model \(D\mid\delta\sim N(\delta,V)\) and prior \(\delta\sim N(m_0,\tau^2)\), with \(V\) treated as known. A common rule declares benefit when \(P(\delta>0\mid D)>\gamma\), for a prespecified cutoff \(\gamma\). This analysis model and prior must be set before examining simulation results. The focus here is how to evaluate the rule under repeated continuous-outcome trials, not how to choose a prior or cutoff.

Posterior result: Under the normal likelihood and normal prior just specified, the posterior is normal with variance \(v=(1/\tau^2+1/V)^{-1}\) and mean \(m=v(m_0/\tau^2+D/V)\). The posterior probability of benefit is \(P(\delta>0\mid D)=\Phi(m/\sqrt{v})\), where \(\Phi\) is the standard normal cumulative distribution function.

From a Replicate to a Decision

The following derivation gives a useful check on both the analysis and the simulation. With \(m_0=0\), the posterior mean is \(m=kD\), where \(k=\tau^2/(\tau^2+V)\), and \(v=Vk\). Since \(k>0\), the posterior-probability rule is equivalent to a threshold on the observed difference:

$$ \begin{aligned} P(\delta>0\mid D)>\gamma &\iff \Phi\left(\frac{kD}{\sqrt{Vk}}\right)>\gamma\\ &\iff D>z_\gamma\sqrt{\frac{V}{k}}, \end{aligned} $$

where \(z_\gamma=\Phi^{-1}(\gamma)\). The last step uses the fact that \(\Phi\) is increasing. This threshold is a property of the stated model, prior, and decision rule. For any data-generating value \(\delta\), the decision rate can then be checked using \(D\sim N(\delta,V)\). In more complicated simulations, the same decision rate is estimated by applying the rule to each simulated replicate.

Worked Example: Calculate a Decision for One Simulated Trial

Suppose \(n_T=n_C=50\), \(\sigma_T=\sigma_C=10\) outcome units, and the true means are \(\mu_C=100\) and \(\mu_T=102\). The true effect is \(\delta=2\) outcome units. Use the prior \(\delta\sim N(0,10^2)\) and declare benefit if the posterior probability exceeds \(\gamma=0.95\). In one hypothetical replicate, suppose the observed difference is \(D=3.2\) outcome units.

The sampling variance is \(V=10^2/50+10^2/50=4\) outcome-units squared. The posterior variance and mean are

$$ v=\left(\frac{1}{100}+\frac{1}{4}\right)^{-1}=3.846,\qquad m=3.846\left(\frac{0}{100}+\frac{3.2}{4}\right)=3.077. $$

The posterior standard deviation is \(\sqrt{3.846}=1.961\) outcome units, so \(P(\delta>0\mid D)=\Phi(3.077/1.961)=\Phi(1.569)\approx0.9417\). Because \(0.9417\) is below \(0.95\), this replicate does not declare benefit. This is one decision, not an estimate of the repeated-trial decision rate.

Estimate Decision Rates Across Replicates

For each scenario, generate \(M\) independent trial replicates. In replicate \(r\), apply the same analysis and rule, and let \(I_r=1\) if the rule declares benefit and \(I_r=0\) otherwise. The estimated decision rate is \(\hat{q}=M^{-1}\sum_{r=1}^{M}I_r\). If the replicate decisions are independent Bernoulli variables with common probability \(q\), the Monte Carlo standard error is approximately \(\sqrt{\hat{q}(1-\hat{q})/M}\). This measures simulation noise, not uncertainty about the clinical effect or the appropriateness of the assumed model.

Worked Example: Check the Null Rate and Power

Use the design and Bayesian rule from the previous example. Here \(k=100/(100+4)=0.9615\), so the decision threshold is \(D>1.6449\sqrt{4/0.9615}\approx3.355\) outcome units. Under the null effect, \(D\sim N(0,4)\); under a true effect of \(4\) outcome units, \(D\sim N(4,4)\).

The theoretical null decision rate is \(P(D>3.355\mid\delta=0)=1-\Phi(3.355/2)\approx0.0467\). At \(\delta=4\), the decision rate (power at this scenario) is \(P(D>3.355\mid\delta=4)=1-\Phi((3.355-4)/2)\approx0.6265\). These are probabilities of the specified rule declaring benefit under the respective data-generating conditions.

Now suppose \(M=10{,}000\) hypothetical independent replicates are run at each condition, yielding 469 null decisions and 6,270 decisions at \(\delta=4\). The estimated rates are \(469/10{,}000=0.0469\) and \(6{,}270/10{,}000=0.6270\). Their Monte Carlo standard errors are

$$ \sqrt{\frac{0.0469(1-0.0469)}{10{,}000}}=0.002114,\qquad \sqrt{\frac{0.6270(1-0.6270)}{10{,}000}}=0.004836. $$

Both simulated rates are close to their corresponding theoretical rates; small differences are expected from finite simulation. A noticeably larger discrepancy would prompt checks of the code, inputs, and number of replicates.

Evaluate Estimator Performance

Decision rates do not describe how accurately an effect is estimated. For each replicate, record the prespecified estimator \(\hat{\delta}_r\), such as the observed difference \(D_r\) or a posterior summary. Across replicates generated at true effect \(\delta\), empirical bias is the mean of \(\hat{\delta}_r-\delta\); empirical variance describes the spread of the estimates around their replicate mean. Root mean squared error (RMSE) is the square root of the average squared error. It combines variability and bias:

$$ \widehat{\operatorname{Bias}}=\frac{1}{M}\sum_{r=1}^M(\hat{\delta}_r-\delta),\quad \widehat{\operatorname{MSE}}=\frac{1}{M}\sum_{r=1}^M(\hat{\delta}_r-\delta)^2,\quad \widehat{\operatorname{RMSE}}=\sqrt{\widehat{\operatorname{MSE}}}. $$

For an unbiased estimator, its theoretical MSE equals its variance. More generally, mean squared error equals variance plus squared bias when variance and bias are defined for the estimator’s sampling distribution. Report the estimator and units: an RMSE of 2 outcome units is not a decision rate and does not mean every trial estimate is within 2 units of the truth.

Worked Example: Summarize Error in the Estimated Treatment Effect

Suppose 10,000 hypothetical replicates are generated with \(n_T=n_C=50\), both outcome standard deviations equal to 10 units, and true effect \(\delta=4\) units. Evaluate the raw difference-in-means estimator \(D\). Assume the simulation’s recorded errors \(e_r=D_r-4\) sum to \(-300\) units, and the squared errors sum to \(40{,}300\) squared units.

The empirical bias is \(-300/10{,}000=-0.030\) outcome units. The empirical MSE is \(40{,}300/10{,}000=4.030\) squared outcome units, so the RMSE is \(\sqrt{4.030}=2.007\) outcome units. The negative bias is small relative to the RMSE in this hypothetical run. Under the stated model, the theoretical sampling variance of \(D\) is \(100/50+100/50=4\) squared units and its theoretical bias is zero, so a simulated MSE near 4 is expected, subject to Monte Carlo variation.

Diagnostics, Alternatives, and Limitations

A sound simulation begins with checks that the generator produces the intended distributions. Across generated replicates, check that the arm means are close to their specified values, the spread of arm outcomes is consistent with the specified variances, and the distribution of \(D\) is consistent with mean \(\delta\) and variance \(V\). Check the treatment-minus-control sign convention with a simple trial where the treatment mean is larger. These checks can reveal swapped arms, use of a standard deviation where a variance is required, or incorrect sample-size divisors.

Compare estimated decision rates with Monte Carlo standard errors and, when available, analytic probabilities. Increase \(M\) if the simulation error is too large for the precision needed; do not treat a small Monte Carlo standard error as evidence that the data-generating assumptions are realistic. Also inspect code for differences between the simulated data model and the analysis model. A mismatch may be deliberate, but then the operating characteristics describe that mismatch and should be reported as such.

When a normal sampling distribution and a simple decision threshold are available, an analytic probability calculation is a useful alternative or cross-check. Simulation is more flexible when the replicate-level analysis is complex, but adds Monte Carlo uncertainty and implementation risk. In either approach, specify the scenario and decision rule; results for one effect and variance combination do not automatically apply to another. A normal, independent, complete-data model may be inadequate for skewed outcomes, outliers, clustering, or other departures. The simulation only answers the question encoded in its assumptions.

  • Wrong: “A simulated decision rate of 0.469 is close to a theoretical rate of 0.0467 because the Monte Carlo standard error is about 0.002.” Correction: With \(M=10{,}000\), a rate of 0.469 has standard error about 0.00499 and is not close to 0.0467. A rate of 0.0469 has standard error about 0.002114.
  • Wrong: “The posterior probability of benefit in one replicate is the trial’s power.” Correction: It is a probability conditional on that replicate’s observed data and the Bayesian model. Power or a corresponding decision rate is the probability of the rule declaring benefit over repeated trials under a specified true effect.
  • Wrong: “A small RMSE means the estimator has no bias.” Correction: RMSE incorporates both bias and variability; assess them separately as well as together.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. With \(n_T=n_C=40\) and both outcome standard deviations equal to 8 units, what is the variance of the difference in sample means?
  2. If a rule declares benefit in 120 of 2,000 null replicates, what is the estimated null decision rate and its approximate Monte Carlo standard error?
  3. For a true effect of 5 units, a simulation gives an average estimator of 4.8 units. What is its empirical bias?
  4. Why should an estimated decision rate be reported with its number of replicates or Monte Carlo standard error?

Solutions. (1) \(V=8^2/40+8^2/40=3.2\) squared outcome units. (2) The rate is \(120/2{,}000=0.0600\); its standard error is \(\sqrt{0.06(0.94)/2{,}000}=0.00531\). (3) The estimated bias is \(4.8-5=-0.2\) outcome units. (4) A finite simulation estimates a probability with Monte Carlo error; the replicate count and standard error indicate the precision of that estimate, not whether the scenario assumptions are correct.

Clinical Biostats