Tutorials › Bayesian Clinical Trials › Confidence Intervals For Simulated Operating Characteristics

Calibrating Operating Characteristics · Tutorial 184 of 696

Confidence Intervals For Simulated Operating Characteristics

Construct and interpret binomial confidence intervals for simulated operating characteristics, while separating Monte Carlo uncertainty from variation among patients and uncertainty about model assumptions.

Advanced 12 min read

What You'll Learn

  • Define a simulated operating characteristic as a probability for a specified scenario and trial procedure.
  • Construct Wilson score intervals from the number of simulated successes and the total replicates.
  • Interpret what a confidence interval does—and does not—say about simulation error and patient-level variability.
  • Compare Wilson, Wald, and exact binomial intervals, including their behavior with rare events.
  • Identify simulation designs for which an ordinary binomial interval is not justified.
  • Explain why a zero observed event count does not establish a zero operating-characteristic probability.

What a Confidence Interval for a Simulation Estimates

A simulated operating characteristic is a probability defined by a trial procedure and a data-generating scenario. Examples include the probability that a decision rule declares success when the null scenario is true, or the probability of success under a specified treatment effect. A simulation estimates this probability using a finite number of trial replicates, so the estimate itself has Monte Carlo uncertainty.

The interval in this tutorial describes uncertainty from having run a finite simulation. It is not an interval for individual patient outcomes, and it does not quantify uncertainty about whether the chosen data-generating model represents future patients. Patient-level variation is already part of the simulated trial process that defines the operating characteristic. The interval instead reflects variation in the estimated probability that would arise if the simulation were independently repeated with the same number of replicates.

Definition: Fix a trial procedure and a data-generating scenario. Let \(\theta\) be the probability that one simulated trial replicate has a specified binary outcome, such as rejecting a null hypothesis or meeting a success rule. If \(M\) independent replicates are simulated and \(K\) have that outcome, then \(K\sim\operatorname{Binomial}(M,\theta)\), and the estimated operating characteristic is \(\hat{\theta}=K/M\). A binomial confidence interval uses \(K\) and \(M\) to quantify Monte Carlo uncertainty about \(\theta\).

The binomial model requires that each replicate produce one binary outcome, that the replicates be independent, and that they share the same success probability \(\theta\). This usually means holding the trial procedure and the scenario fixed while independently generating each simulated trial. Any randomness within a trial—such as patient responses, enrollment, or a randomized treatment allocation—is included in the replicate outcome. It does not make the replicate-level outcome non-binary.

The target \(\theta\) is conditional on the scenario as specified. If uncertain scenario parameters are drawn anew for each replicate, the interval can still describe the Monte Carlo precision of the resulting average probability, provided the replicate outcomes remain independent and identically distributed. But it does not isolate uncertainty about the parameter values from uncertainty induced by averaging over those draws. The interpretation must match the simulation design.

The Wilson Score Confidence Interval

A useful default for a binomial probability is the Wilson score interval. It behaves well for probabilities near zero or one and for modest numbers of events, unlike the simple Wald interval. For a two-sided confidence level \(1-\alpha\), let \(z_{1-\alpha/2}\) be the corresponding standard normal quantile. The Wilson interval is:

$$ \frac{ \hat{\theta}+\dfrac{z_{1-\alpha/2}^{\,2}}{2M} \ \pm\ z_{1-\alpha/2} \sqrt{\dfrac{\hat{\theta}(1-\hat{\theta})}{M} +\dfrac{z_{1-\alpha/2}^{\,2}}{4M^2}} }{ 1+\dfrac{z_{1-\alpha/2}^{\,2}}{M} }. $$

The plus and minus signs give the upper and lower endpoints, respectively. The interval is bounded between zero and one. It is often described as a score interval because it is obtained by inverting a test based on the standardized difference between the observed proportion and a candidate value of \(\theta\).

Interpretation: Under the binomial model, a 95% Wilson confidence procedure has approximately 95% coverage across repeated independent simulations: in the long run, about 95% of intervals constructed this way contain the fixed replicate-level probability \(\theta\). Once an interval has been calculated, it is not correct to say there is a 95% probability that the fixed \(\theta\) lies in that particular interval.

The “approximately” matters: the binomial count is discrete, so a procedure based on a normal score approximation need not have exactly its nominal coverage for every \(M\) and \(\theta\). Wilson intervals generally have more reliable coverage than Wald intervals, but they are not exact intervals.

Why the Wilson Formula Has This Form

The score construction starts with a candidate value \(\theta\) and asks whether the observed replicate proportion \(\hat{\theta}\) is too far from it. Under the binomial model, the estimated variance of \(\hat{\theta}\) when testing that candidate is \(\theta(1-\theta)/M\). Retaining \(\theta\), rather than replacing it with \(\hat{\theta}\) in the standard error, gives the score inequality:

$$ \left|\frac{\hat{\theta}-\theta} {\sqrt{\theta(1-\theta)/M}}\right| \le z_{1-\alpha/2}. $$

To obtain the interval, square both sides, multiply by the positive quantity \(M\theta(1-\theta)\), and collect terms in \(\theta\):

$$ M(\hat{\theta}-\theta)^2 \le z_{1-\alpha/2}^{\,2}\theta(1-\theta), $$
$$ (M+z_{1-\alpha/2}^{\,2})\theta^2 -(2M\hat{\theta}+z_{1-\alpha/2}^{\,2})\theta +M\hat{\theta}^{\,2}\le 0. $$

The candidate values satisfying this quadratic inequality lie between its two roots. Applying the quadratic formula and dividing numerator and denominator by \(M\) gives the Wilson endpoints shown above. This inversion also explains why the interval is centered near, but not generally exactly at, \(\hat{\theta}\): the denominator and the added terms account for the binomial variance depending on the candidate probability.

Worked Examples

Worked Example: Simulated Type I Error

Suppose a hypothetical calibration simulates \(M=1{,}000\) independent trials under a specified null scenario. The decision rule declares success in \(K=23\) replicates. Estimate the false-positive probability and form a 95% Wilson interval. The specified scenario, procedure, and replicate-level success outcome are held fixed, and each replicate is independently generated, so the binomial assumptions apply.

The estimate is \(\hat{\theta}=23/1{,}000=0.0230\), or 2.30%. For a 95% interval, \(z_{0.975}=1.96\) and \(z^2=3.8416\). The Wilson center is:

$$ \frac{0.0230+3.8416/(2\times1{,}000)} {1+3.8416/1{,}000} = \frac{0.0249208}{1.0038416} \approx 0.02483. $$

The amount added to and subtracted from that center is:

$$ \frac{1.96\sqrt{(0.0230)(0.9770)/1{,}000+ 3.8416/(4\times1{,}000^2)}} {1+3.8416/1{,}000} = \frac{1.96\sqrt{0.0000234314}}{1.0038416} \approx 0.00945. $$

Thus the 95% Wilson interval is approximately \(0.02483\pm0.00945\), or \((0.0154,\,0.0343)\). In context, the simulated false-positive estimate is 2.30%, with a 95% confidence interval of about 1.54% to 3.43% for the false-positive probability under this specified null scenario and procedure. It is not an interval for the error rate of every possible null scenario.

Worked Example: Probability of Trial Success

In a separate hypothetical scenario, \(M=1{,}000\) independent simulated trials are generated under a specified treatment effect. The decision rule meets its success criterion in \(K=742\) trials. Assume each replicate is generated under the same scenario and procedure and is independent of the others.

The estimated probability of success is \(\hat{\theta}=742/1{,}000=0.742\). Using \(z=1.96\), the center and half-width are:

$$ \text{center}= \frac{0.742+3.8416/2{,}000}{1+3.8416/1{,}000} = \frac{0.7439208}{1.0038416} \approx 0.7411, $$
$$ \text{half-width}= \frac{1.96\sqrt{(0.742)(0.258)/1{,}000+ 3.8416/(4\times1{,}000^2)}}{1.0038416} \approx 0.02708. $$

The interval is \(0.7411\pm0.02708\), approximately \((0.714,\,0.768)\). The estimated success probability is 74.2%, and the interval conveys Monte Carlo uncertainty about the replicate-level success probability for this scenario and procedure. It does not mean that 71.4% to 76.8% of patients in a trial will succeed; the simulated outcome being counted is whether an entire trial meets the decision rule.

Worked Example: No Events in a Small Simulation

Suppose a hypothetical simulation produces \(K=0\) false positives among \(M=100\) independent replicates under one fixed null scenario. The estimated rate is zero. The Wilson center is:

$$ \frac{0+3.8416/(2\times100)}{1+3.8416/100} = \frac{0.019208}{1.038416} \approx 0.01850. $$

The half-width is:

$$ \frac{1.96\sqrt{0+3.8416/(4\times100^2)}}{1.038416} = \frac{1.96\sqrt{0.00009604}}{1.038416} \approx 0.01850. $$

The interval is therefore approximately \((0,\,0.0370)\). No false positives were observed in these 100 replicates, but the result does not establish that the underlying false-positive probability is zero. The upper endpoint indicates that probabilities of several percent remain compatible with this finite simulation under the interval procedure.

Alternatives, Diagnostics, and Failure Modes

The Wald interval uses \(\hat{\theta}\pm z\sqrt{\hat{\theta}(1-\hat{\theta})/M}\). It is easy to calculate but can have poor coverage, especially with few events or when \(\hat{\theta}\) is near zero or one; it can even extend below zero or above one. In the zero-event example, its estimated standard error is zero, so it gives the misleading interval \((0,0)\). This is a reason not to use it as the default for simulated operating characteristics.

An exact Clopper–Pearson interval is obtained by inverting binomial tests and has coverage at least the nominal level under the binomial model. Its coverage can be conservative, meaning that it may cover more often than the stated confidence level, and its intervals are often wider than Wilson intervals. It is a useful alternative when a conservative exact procedure is required or when sparse outcomes make the approximation of a score interval a concern. Neither method corrects a simulation design that violates the binomial assumptions.

Before interpreting an interval, check the replicate-level data and the simulation design. Each replicate should contribute exactly one binary result to the count, and the total \(M\) should be the number of valid independent replicates for that scenario. If replicates share randomness in a way that makes their outcomes dependent, or if weighted outcomes are used, the ordinary binomial interval is not justified by the count alone. If replicates use different success probabilities, their sum is generally not binomial with one common \(\theta\). A calculation that treats such outcomes as identically distributed can understate or otherwise misrepresent Monte Carlo uncertainty.

Common pitfall: “None of 100 simulated trials were false positives, so the false-positive probability is zero.” The correction is that zero is the observed estimate, not proof that the underlying probability is zero. A suitable interval, such as the Wilson interval in the example, has a positive upper endpoint and makes the finite simulation’s precision visible.

Another important limitation is the scope of the target. A narrow interval indicates that the simulation has estimated \(\theta\) precisely for the scenario and procedure used; it does not establish that the scenario is clinically plausible, that all relevant scenarios were considered, or that a prior and decision rule are appropriate. Those questions require scientific and design judgments beyond binomial Monte Carlo uncertainty. In Bayesian trial calibration, the interval is a confidence interval for a simulation probability, not a posterior credible interval for a model parameter.

In practice, report the event count \(K\), the number of replicates \(M\), the estimate \(K/M\), the interval method, and the interval endpoints. State the scenario and the replicate-level event in context. Reporting just the estimated percentage hides how much it may change through simulation noise; reporting just the interval hides the information in the observed count and total.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. A fixed scenario yields 40 successes among 500 independent simulated trials. What is the estimated success probability, and what source of uncertainty does a confidence interval describe?
  2. Why is a zero-width Wald interval inappropriate when no events occur in a finite simulation?
  3. Would the ordinary binomial interval automatically be valid if every replicate had a different success probability? Explain.
  4. Does a 95% Wilson interval mean there is a 95% probability that the fixed operating characteristic lies in the calculated interval?

Solutions. (1) The estimate is \(40/500=0.0800\), or 8.00%. The interval describes Monte Carlo uncertainty from using 500 replicates to estimate the replicate-level probability under the specified scenario and procedure. (2) When \(\hat{\theta}=0\), the Wald standard error \( \sqrt{\hat{\theta}(1-\hat{\theta})/M}\) is zero, which falsely suggests no uncertainty. A Wilson or exact interval has a positive upper endpoint. (3) No. With different replicate probabilities, the count is generally not binomial with one common probability; an ordinary binomial interval does not automatically apply. (4) No. The fixed probability is not random in the frequentist interpretation. The 95% describes the long-run coverage of the interval-construction procedure under its assumptions.

Clinical Biostats