Tutorials › Bayesian Clinical Trials › Estimating Type I Error For Bayesian Decision Rules

Calibrating Operating Characteristics · Tutorial 191 of 696

Estimating Type I Error For Bayesian Decision Rules

Learn how to simulate trials under a specified null effect, apply a fixed Bayesian success rule, and quantify uncertainty in the estimated Type I error.

Advanced 12 min read

What You'll Learn

  • Define Type I error for a Bayesian trial decision rule at a specified null treatment effect.
  • Apply a fixed posterior-probability threshold consistently across simulated trials.
  • Estimate the false-positive rate from replicate-level success indicators.
  • Calculate and interpret the Monte Carlo standard error of the estimate.
  • Check the simulation setup, trial failures, and results for common problems.
  • Distinguish simulation uncertainty from uncertainty about the trial model and assumptions.

What Type I Error Means for a Bayesian Decision Rule

A Bayesian trial may declare success when the posterior probability of a clinically favorable treatment effect exceeds a chosen threshold. That rule is based on the posterior distribution in one trial. Its Type I error, by contrast, describes how often the rule declares success across repeated trials generated under a null treatment effect. It is a property of the complete trial procedure under that specified scenario, not a posterior probability that the null hypothesis is true.

For example, fix the success rule “declare success if the posterior probability that the treatment effect exceeds zero is at least 0.95.” To estimate its Type I error at a true treatment effect of zero, repeatedly generate trial data under that effect, apply the same analysis and rule to every simulated trial, and count the declarations of success. The decision threshold must be held fixed during this estimation.

Definition: Let \(\theta\) denote the treatment effect and let \(\theta_0\) be a specified null value. For a trial procedure with a fixed analysis and decision rule, its Type I error at \(\theta_0\) is the probability of declaring success when the data are generated under \(\theta=\theta_0\). A simulation estimate is the fraction of simulated trials under that scenario in which the procedure declares success.

This definition concerns a specified null scenario. If other features of the data-generating mechanism matter—such as the control-group outcome rate, outcome variability, or allocation ratio—they must also be specified. A result is conditional on those scenario choices. The definition here does not by itself summarize behavior over a composite null hypothesis.

Specify the Procedure Before Simulating

A simulation is meaningful only if each replicate represents the same intended procedure. State the data-generating mechanism under the null, the analysis model and prior, and the rule that maps trial data to a decision. Keep sample size, allocation, follow-up, handling of missing outcomes, and any interim or stopping rules fixed unless those features are explicitly randomized by the scenario.

Here is a simple model used in the first worked example. Suppose outcomes in each arm are independent and normally distributed with a known common standard deviation \(\sigma\), and each arm has \(n\) participants. Write \(\theta=\mu_T-\mu_C\) for the treatment-minus-control mean difference. For the observed difference \(D=\bar{x}_T-\bar{x}_C\), the analysis likelihood is \(D\mid\theta\sim N(\theta,2\sigma^2/n)\). Suppose the prior is \(\theta\sim N(0,\tau^2)\), and the fixed rule declares success when \(P(\theta>0\mid D)\ge c\). These assumptions make the posterior calculation explicit; they are not necessary for the general simulation definition.

Worked Example: Apply the Fixed Posterior Rule to One Trial

Consider a hypothetical trial with \(n=25\) participants per arm, known outcome standard deviation \(\sigma=10\) points, and prior \(\theta\sim N(0,100)\), so the prior standard deviation is 10 points. The observed treatment-minus-control difference is \(D=5.2\) points. The fixed rule declares success if \(P(\theta>0\mid D)\ge0.95\).

Under the stated independent, normal-outcome model, the sampling variance of \(D\) is \(v=10^2/25+10^2/25=8\) points squared. Normal-prior, normal-likelihood updating gives posterior variance \(\tau^2v/(\tau^2+v)\) and posterior mean \(\tau^2D/(\tau^2+v)\). Substituting \(\tau^2=100\), \(v=8\), and \(D=5.2\), the posterior mean is \(100(5.2)/108=4.815\) points and the posterior variance is \(800/108=7.407\) points squared. Thus the posterior standard deviation is \(\sqrt{7.407}=2.722\) points.

The posterior probability of a positive effect is therefore \(P(\theta>0\mid D)=\Phi(4.815/2.722)=\Phi(1.769)\approx0.9616\), where \(\Phi\) is the standard normal cumulative distribution function. Since \(0.9616\ge0.95\), this simulated trial is recorded as a success. That one decision is not a Type I error estimate; the estimate requires many simulated trials under the specified null.

Estimate the Error Rate From Replicates

For replicate \(r\), define \(I_r=1\) if the procedure declares success and \(I_r=0\) otherwise. Generate \(R\) independent trial replicates under the specified null scenario, and apply the same procedure to each. If \(\alpha(\theta_0)\) denotes the true Type I error for that scenario, then each indicator has a Bernoulli distribution with success probability \(\alpha(\theta_0)\). The estimated Type I error is the sample mean of these indicators.

$$ \widehat{\alpha}(\theta_0)=\frac{1}{R}\sum_{r=1}^{R} I_r =\frac{K}{R}, $$

where \(K\) is the number of simulated trials that declared success. Under independent replicates generated from the same scenario, \(E(I_r)=\alpha(\theta_0)\), so \(E\{\widehat{\alpha}(\theta_0)\}=\alpha(\theta_0)\). Also, \(\operatorname{Var}(I_r)=\alpha(\theta_0)\{1-\alpha(\theta_0)\}\). Independence gives \(\operatorname{Var}\{\widehat{\alpha}(\theta_0)\}=\alpha(\theta_0)\{1-\alpha(\theta_0)\}/R\). Replacing the unknown rate by its estimate yields the estimated Monte Carlo standard error (MCSE).

$$ \widehat{SE}_{MC} = \sqrt{\frac{\widehat{\alpha}(\theta_0) \{1-\widehat{\alpha}(\theta_0)\}}{R}}. $$

The MCSE measures the simulation’s numerical uncertainty from using a finite number of replicates. It does not measure uncertainty about whether the data-generating model, prior, or chosen null scenario is scientifically appropriate. Increasing \(R\) reduces this simulation uncertainty, but does not correct a misspecified scenario or an incorrectly implemented decision rule.

Worked Example: Estimate Type I Error and Its Monte Carlo Uncertainty

Suppose 2,000 hypothetical trial replicates are generated with the true treatment effect set to \(\theta_0=0\). The same posterior model and fixed 0.95 success threshold are used in every replicate. The procedure declares success in 86 trials. Assume the replicates are independent and that each follows the specified null data-generating mechanism.

The estimated Type I error is \(\widehat{\alpha}(0)=86/2000=0.043\), or 4.3%. Its MCSE is \(\sqrt{0.043(1-0.043)/2000}=\sqrt{0.0000205755}\approx0.00454\), or about 0.45 percentage points. The arithmetic uses \(0.043(0.957)=0.041151\), divided by 2,000.

A rough normal-approximation interval for simulation uncertainty is \(0.043\pm1.96(0.004536)\), which is approximately \([0.0341,0.0519]\). This interval describes uncertainty in the simulated estimate under the repeated-replication model; it is not a posterior interval for the Type I error and does not account for uncertainty in the scenario assumptions. The result suggests a false-positive rate of about 4.3% at this specified null scenario, with non-negligible Monte Carlo uncertainty.

Checking the Simulation and Interpreting Its Result

Before interpreting a rate, verify that the replicate-level indicator answers the intended question. It should equal one exactly when the complete, pre-specified procedure declares success. If a trial can stop early, fail to produce an analyzable outcome, or trigger a fallback analysis, those possibilities must be handled according to a rule fixed in advance. Quietly dropping non-evaluable replicates changes the denominator and may change the operating characteristic being estimated.

Useful checks include confirming that the treatment effect is set to the specified null value in the generator, checking representative simulated data against the intended distributions, and testing that the posterior calculation and threshold comparison behave as expected. Under a single fixed data set and otherwise identical rule, raising the required posterior probability cannot create additional declarations of success: a trial passing the stricter threshold must also pass the lower one. A violation of this property can reveal a coding or reporting error.

A small number of replicates may make the estimate noisy, especially when the rate is near zero. Report \(R\), \(K\), the estimated rate, and its MCSE so readers can assess that precision. If no simulated trial declares success, the estimate is zero, but that does not establish that the true error rate is zero. Likewise, a high or unexpected estimate should prompt checks of the generator, analysis, and rule before any substantive conclusion.

Worked Example: Compare Two Fixed Thresholds on the Same Null Trials

In 1,000 hypothetical replicates generated under the same specified null scenario, a 0.90 posterior-probability threshold produces 64 declarations of success, while a 0.95 threshold produces 38. The analysis model and all other trial features are identical. The estimated rates are \(64/1000=0.064\) and \(38/1000=0.038\), respectively.

Their separate MCSEs are \(\sqrt{0.064(0.936)/1000}=\sqrt{0.000059904}\approx0.00774\) and \(\sqrt{0.038(0.962)/1000}=\sqrt{0.000036556}\approx0.00605\). Thus, the estimated Type I error is 6.4% for the 0.90 rule and 3.8% for the 0.95 rule in this scenario. The lower rate for the stricter threshold is consistent with the nesting of the two rules. Because the same trials were used for both thresholds, their estimates are dependent; treating them as independent would not be a justified way to quantify uncertainty in their difference.

How This Estimate Relates to Other Approaches

Simulation is useful when the complete trial procedure is too complicated for a convenient probability calculation. It can incorporate realistic features such as unequal allocation, complicated outcome distributions, or pre-specified interim decisions, provided those features are implemented in the generator and analysis. The estimate still answers a conditional question: how often this coded procedure declares success under this coded scenario.

When a simple model permits an exact or reliable analytic calculation, that calculation can serve as a benchmark for checking the simulation. In the normal example above, the posterior probability is a monotone function of \(D\), so the Bayesian rule can be expressed as a threshold on \(D\); under the assumed null, the distribution of \(D\) then gives an analytic false-positive probability. Such a benchmark is valuable for verifying code, but may be unavailable for more complex trial procedures. A frequentist test with a prespecified critical value is another possible procedure; it has its own rejection rule and must be evaluated under the same null scenario for a direct operating-characteristic comparison. The Bayesian posterior threshold does not automatically imply any particular frequentist error rate.

The principal limitation is that the estimate reflects only the scenarios actually simulated. A rate at \(\theta_0=0\) does not establish the error rate for other null values or nuisance-parameter settings. Nor can a large simulation repair an inappropriate outcome model, prior, or handling rule. Keep the assumed scenario and the resulting conditional interpretation explicit.

Common Mistake

Common mistake: “The rule requires a 95% posterior probability, so its Type I error must be 5%.” This confuses a probability calculated from one trial’s posterior distribution with a repeated-trial probability under a null data-generating scenario. The Type I error must be evaluated for the full procedure under that scenario; it may be below or above 5%. Estimate it by simulating null trials and counting how often the fixed rule declares success.

Check Your Understanding

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

  1. In 3,000 independent null replicates, 120 trials declare success. What is the estimated Type I error?
  2. For the estimate in question 1, calculate the MCSE to three significant figures.
  3. Why does a zero success count in a finite simulation not prove that the true Type I error is zero?
  4. Two fixed posterior thresholds are applied to the same simulated trials. Why should their estimated rates not automatically be treated as independent when comparing them?

Solutions. (1) The estimate is \(120/3000=0.040\), or 4.0%, under the specified null scenario. (2) The MCSE is \(\sqrt{0.040(0.960)/3000}=\sqrt{0.0000128}\approx0.00358\), or 0.358 percentage points. (3) A finite set of replicates may contain no successes even when the underlying success probability is positive; the estimate has finite Monte Carlo uncertainty. (4) Each trial contributes to both threshold indicators, so the paired outcomes are dependent. The dependence must be taken into account when estimating uncertainty in the difference between rates.

Clinical Biostats