Tutorials › Bayesian Clinical Trials › Time-To-Event Outcomes In Operating-Characteristic Simulations

Calibrating Operating Characteristics · Tutorial 207 of 696

Time-To-Event Outcomes In Operating-Characteristic Simulations

Generate realistic time-to-event data under explicit hazard and censoring assumptions, then use a fixed Bayesian rule to estimate trial operating characteristics.

Advanced 13 min read

What You'll Learn

  • Generate event times from constant or piecewise-constant hazards using the cumulative hazard.
  • Represent right censoring and construct each participant’s observed time and event indicator.
  • Connect event counts and exposure time to an exponential survival-model likelihood.
  • Apply the same Bayesian analysis and decision threshold to every simulated trial.
  • Estimate decision rates and quantify their Monte Carlo standard errors.
  • Diagnose simulation and analysis choices that can distort operating characteristics.

Why Time-to-Event Simulation Needs Its Own Design

A time-to-event outcome is not just a binary indicator of whether an event occurred. Its timing carries information, and some participants may be censored before an event is observed. A trial simulation must therefore specify how event times arise, how censoring occurs, what information the analysis uses, and what decision is made from the analysis. Changing any of these can change the operating characteristic being estimated.

The task here is to generate event and censoring times under specified hazard patterns, then apply a fixed analysis and decision rule to every simulated trial. “Fixed” means that the analysis model, prior, endpoint definition, and decision threshold are held constant across simulated replicates. The simulated data-generating assumptions may vary across scenarios, but the rule being evaluated must not be silently changed from one scenario to another.

Definition: The event time \(T\) is the time from a defined origin to the event of interest. The censoring time \(C\) is the time at which observation ends without an event being observed. With right censoring, the recorded time is \(Y=\min(T,C)\), and the event indicator is \(\delta=I(T\leq C)\), where \(\delta=1\) denotes an observed event and \(\delta=0\) denotes right censoring.

A hazard function \(\lambda(t)\) describes the instantaneous event rate at time \(t\), conditional on remaining event-free just before \(t\). Its cumulative hazard is \(H(t)=\int_0^t \lambda(u)\,du\). The survival function, the probability of remaining event-free beyond time \(t\), is \(S(t)=\exp\{-H(t)\}\). These quantities are defined separately for each trial arm when their hazards differ.

Generating Event and Censoring Times

An inverse-transform construction provides a direct way to generate event times. If \(U\) is drawn from a uniform distribution on \((0,1)\), then \(-\log(U)\) has an exponential distribution with mean 1. Equating this random quantity to the cumulative hazard gives the event time:

$$ T=H^{-1}\{-\log(U)\}. $$

This formula assumes the specified cumulative hazard is continuous and can be inverted over the times being simulated. For a constant hazard \(\lambda\), \(H(t)=\lambda t\), so \(T=-\log(U)/\lambda\). For a piecewise-constant hazard, compute the cumulative hazard in each time segment and find the segment in which \(-\log(U)\) falls.

Censoring must be generated according to the intended design scenario. For example, with administrative follow-up ending at a fixed time \(\tau\), set \(C=\tau\). Under independent random censoring, generate \(C\) from a specified censoring-time distribution independently of \(T\), conditional on any design variables used in the scenario. The observed data are then \((Y,\delta)\). Independent censoring is a key assumption for the usual event-time likelihood: censoring should not carry additional information about a participant’s event time after conditioning on modeled variables. If censoring depends on unmodeled prognosis, the analysis may not have the interpretation assumed by the simulation.

A useful derivation explains why event counts and observed exposure time appear in the exponential-model likelihood. With a constant event hazard \(\lambda\), an observed event at time \(y\) contributes density \(\lambda\exp(-\lambda y)\). A censored observation at time \(y\) contributes survival probability \(\exp(-\lambda y)\). Combining these contributions for independent participants gives:

$$ L(\lambda\mid \{Y_i,\delta_i\}) =\prod_i \{\lambda^{\delta_i}\exp(-\lambda Y_i)\} =\lambda^D\exp(-\lambda E), \qquad D=\sum_i\delta_i,\quad E=\sum_iY_i. $$

Here \(D\) is the number of observed events and \(E\) is total observed person-time. This likelihood is appropriate for an exponential event-time analysis with independent censoring; it does not make a constant hazard correct for every possible data-generating pattern.

Worked Example: Generating a Piecewise-Hazard Event Time

Suppose a hypothetical treatment arm has hazard 0.03 per month through month 6 and 0.06 per month thereafter. For a generated value \(U=0.20\), find the event time.

First calculate the cumulative-hazard draw, \(-\log(0.20)=1.609\). The cumulative hazard through month 6 is \(0.03(6)=0.18\), so the draw falls after month 6. The remaining cumulative hazard is \(1.609-0.18=1.429\). At a hazard of 0.06 per month, this takes \(1.429/0.06=23.82\) additional months. Thus \(T=6+23.82=29.82\) months.

If administrative follow-up ends at month 24, the recorded data for this participant are \(Y=24\) months and \(\delta=0\). The simulated event time exceeds the observation window, so the participant is right-censored at 24 months. The data record the censoring time, not a claim that the event occurred at month 24.

Specify the Analysis and Decision Before Simulating

A complete operating-characteristic calculation requires an analysis and a decision rule in addition to a data-generating model. As a simple fixed analysis, suppose each arm is analyzed with an exponential event-time model and a Gamma prior on its hazard. Use the shape-rate parameterization: if \(\lambda\sim\mathrm{Gamma}(a,b)\), then the density is proportional to \(\lambda^{a-1}\exp(-b\lambda)\), and \(b\) has units of time. With independent priors \(\mathrm{Gamma}(a_0,b_0)\) in the two arms, the likelihood above gives the posterior:

$$ \lambda_g\mid \text{data}\sim \mathrm{Gamma}(a_0+D_g,\ b_0+E_g), \qquad g\in\{C,T\}. $$

For illustration, define benefit as a lower treatment-arm hazard and declare success when \(P(\lambda_T<\lambda_C\mid\text{data})>0.95\). This is one possible rule, not a universal clinical criterion. The prior, endpoint, direction of benefit, and cutoff must be specified before evaluating the simulation. The posterior probability may be calculated by numerical integration or by drawing posterior hazards and estimating the fraction of draws satisfying \(\lambda_T<\lambda_C\).

Worked Example: Applying a Fixed Posterior Decision Rule

Consider hypothetical data from four participants per arm. In the control arm, three events occur at months 3, 5, and 10, and one participant is censored at month 8. In the treatment arm, three events occur at months 4, 9, and 10, and one participant is censored at month 7. Assume independent censoring and use the exponential analysis with independent \(\mathrm{Gamma}(1,0.02)\) priors; hazards are measured per month.

For control, \(D_C=3\) and \(E_C=3+5+10+8=26\) person-months. Its posterior is \(\mathrm{Gamma}(4,26.02)\). For treatment, \(D_T=3\) and \(E_T=4+7+9+10=30\) person-months, giving \(\mathrm{Gamma}(4,30.02)\).

To evaluate \(P(\lambda_T<\lambda_C\mid\text{data})\), write \(G_T=30.02\lambda_T\) and \(G_C=26.02\lambda_C\). These are independent \(\mathrm{Gamma}(4,1)\) random variables. The event \(\lambda_T<\lambda_C\) is equivalent to \(G_T/G_C<30.02/26.02\). For equal-rate Gamma variables, \(G_T/(G_T+G_C)\) has a \(\mathrm{Beta}(4,4)\) distribution. Therefore the desired probability is the \(\mathrm{Beta}(4,4)\) cumulative probability at \(30.02/(30.02+26.02)=0.5357\), approximately 0.578.

Because 0.578 is below the prespecified cutoff of 0.95, this simulated trial does not meet the success rule. This conclusion is about the chosen posterior decision rule, not proof that the treatment has no benefit.

Estimating Operating Characteristics Across Replicates

For each simulated trial, generate the participants’ event times under the scenario of interest, generate censoring times, construct the observed data, fit the fixed analysis, and apply the fixed decision rule. If \(R\) independent trial replicates are simulated and \(I_r=1\) when replicate \(r\) meets the decision rule, the estimated probability of a decision is \(\hat{q}=R^{-1}\sum_{r=1}^{R}I_r\). Under repeated independent simulation, its Monte Carlo standard error is estimated by \(\sqrt{\hat{q}(1-\hat{q})/R}\). This quantifies simulation noise, not uncertainty about the clinical truth or the accuracy of the data-generating assumptions.

Worked Example: Estimating Type I Error and Power

Suppose a hypothetical simulation uses 10,000 replicates per scenario, 50 participants per arm, and administrative censoring at 12 months. Each replicate is analyzed with the same exponential model, the same \(\mathrm{Gamma}(1,0.02)\) priors, and the rule \(P(\lambda_T<\lambda_C\mid\text{data})>0.95\).

Under a null scenario with equal hazards of 0.05 events per month, suppose 402 of 10,000 replicates meet the rule. The estimated false-positive rate is \(402/10{,}000=0.0402\). Its Monte Carlo standard error is \(\sqrt{0.0402(1-0.0402)/10{,}000}=0.00196\). Thus the estimated rate is about 4.02%, with Monte Carlo standard error about 0.20 percentage points.

Under a separate alternative scenario with control hazard 0.05 and treatment hazard 0.03 events per month, suppose 7,270 replicates meet the rule. Estimated power is \(7{,}270/10{,}000=0.727\), or 72.7%. Its Monte Carlo standard error is \(\sqrt{0.727(1-0.727)/10{,}000}=0.00446\), about 0.45 percentage points. These are illustrative hypothetical simulation results; they describe the stated scenarios and rule, not any real trial.

Diagnostics, Alternatives, and Limitations

Check the simulation at both the individual-record and trial-summary levels. For a constant hazard \(\lambda\), simulated uncensored event times should have survival probabilities close to \(\exp(-\lambda t)\); for a piecewise hazard, the corresponding survival curve should follow \(\exp\{-H(t)\}\). Confirm that event indicators, observed times, and exposure totals agree with the generation code. In particular, an event after the observation window must be censored, and a participant censored before an event must contribute exposure only through the censoring time.

Also inspect event counts, total person-time, and censoring proportions by arm and scenario. Unexpectedly few events can make posterior decisions unstable or leave a simulated operating characteristic dominated by prior influence. A useful implementation check is to compare a small number of generated records with hand calculations and to repeat the simulation with a different random-number seed. Increasing \(R\) reduces Monte Carlo error, but cannot correct an incorrect hazard pattern, a coding error, or a mismatch between the analysis and decision rule intended for evaluation.

ApproachUseful whenMain limitation
Exponential event-time generationA constant hazard is a defensible scenario and simple event-time generation is desired.It cannot represent changing hazards without extending the model.
Piecewise-exponential generationHazards are expected to change across specified time intervals.Results depend on the selected intervals and hazard values.
Weibull generationA smoothly increasing or decreasing hazard is a useful parametric scenario.Its shape imposes a particular hazard trajectory.
Fixed administrative censoringEvery participant has the same prespecified observation limit.It does not represent variable follow-up times by itself.

These are choices for generating scenarios; they need not match the model used in the fixed analysis. The analysis should remain the one whose performance is being evaluated. For example, if the analysis assumes an exponential hazard but the simulation uses changing hazards, the resulting decision rate still answers a defined question: how that fixed rule performs under that specified scenario. A full investigation of analysis-model misspecification is a separate task.

A common mistake is to treat a censored time as an event time, or to drop censored participants entirely. The first error invents events at censoring; the second discards their observed event-free exposure. In the exponential likelihood, an event contributes both an event and exposure, while a censored observation contributes exposure but no event. Another mistake is to interpret a Monte Carlo standard error as uncertainty about the true event hazard. It measures only the finite number of simulated replicates.

Key takeaway: Operating characteristics for time-to-event trials depend jointly on the event-time scenario, the censoring mechanism, the fixed analysis, and the decision rule. State each explicitly, verify generated records, and report the Monte Carlo uncertainty of estimated decision rates.

Check Your Understanding

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

  1. With a constant hazard of 0.04 per month and \(U=0.50\), what event time does inverse-transform generation produce?
  2. A participant is censored at month 9 without an observed event. What are \(Y\) and \(\delta\), and how much exposure do they contribute to the exponential likelihood?
  3. In the fixed Bayesian analysis above, what is the posterior distribution for an arm with 5 events and 40 person-months of exposure?
  4. In 5,000 simulation replicates, a rule is met 250 times. Estimate the decision rate and its Monte Carlo standard error.

Solutions. (1) \(T=-\log(0.50)/0.04=17.33\) months. (2) \(Y=9\) months and \(\delta=0\); the participant contributes 9 person-months of exposure and no event. (3) The posterior is \(\mathrm{Gamma}(1+5,0.02+40)=\mathrm{Gamma}(6,40.02)\), with rate measured per month. (4) The estimated rate is \(250/5{,}000=0.05\); the Monte Carlo standard error is \(\sqrt{0.05(0.95)/5{,}000}=0.00308\), or about 0.31 percentage points.

Clinical Biostats