Tutorials › Bayesian Clinical Trials › Time-to-Event Benefit Under a Piecewise Exponential Model

Case Studies · Tutorial 666 of 696

Time-to-Event Benefit Under a Piecewise Exponential Model

Learn how to estimate fixed-time survival and posterior evidence of treatment benefit from a piecewise exponential model.

Advanced 11 min read

What You'll Learn

  • Specify the piecewise exponential survival model and its censoring assumptions.
  • Derive the Gamma posterior for each interval-specific hazard from event counts and person-time.
  • Calculate posterior mean survival at a prespecified time.
  • Estimate the posterior probability that treatment improves survival at that time.
  • Check model fit, prior sensitivity, and the implications of interval choices.
  • Distinguish posterior evidence of benefit from a frequentist test or a proportional-hazards summary.

Why Model Survival in Pieces?

A randomized trial may ask whether treatment improves the probability that a participant remains alive and event-free through a clinically meaningful time, such as 12 months. A piecewise exponential model answers this by allowing the event hazard to be constant within each prespecified time interval but to differ between intervals. It can represent a changing hazard without requiring one constant hazard over the entire follow-up period.

The target here is survival at a fixed time, not a hazard ratio. We will calculate each arm's posterior distribution for survival at that time and then assess the posterior probability that treatment-arm survival exceeds control-arm survival. The time point and the meaning of the event must be specified before interpreting the comparison.

Definition: Let \(g\in\{C,T\}\) index control and treatment, and let \(0=t_0<t_1<\cdots<t_J=\tau\) define intervals ending at the target time \(\tau\). In arm \(g\), the piecewise exponential model has hazard \(\lambda_{gj}\) within interval \((t_{j-1},t_j]\). Its survival probability at \(\tau\) is $$ S_g(\tau)=\exp\left(-\sum_{j=1}^{J}\lambda_{gj}(t_j-t_{j-1})\right). $$ Here a larger \(S_g(\tau)\) means a greater probability of being event-free through \(\tau\).

For a participant who remains at risk in an interval for \(y\) time units, the model assigns an event-time density proportional to \(\lambda_{gj}\exp(-\lambda_{gj}y)\). If the participant is censored, the likelihood contribution is the probability of surviving to the censoring time, \(\exp(-\lambda_{gj}y)\). Thus, for each arm and interval, the data can be summarized by \(d_{gj}\), the number of observed events, and \(Y_{gj}\), the total person-time at risk in that interval.

This likelihood assumes that event times are independent across participants conditional on the arm-specific hazards, and that censoring is noninformative: conditional on the model and observed information, censoring does not depend on a participant's unobserved future event time. The hazards are constant within the chosen intervals. Randomization supports a treatment comparison, but it does not by itself guarantee these modeling assumptions.

Posterior Distribution for the Interval Hazards

Use independent Gamma priors for the interval hazards, with the shape-rate parameterization: \(\lambda_{gj}\sim\operatorname{Gamma}(a_{gj},b_{gj})\), so the prior mean is \(a_{gj}/b_{gj}\). Conditional on the specified model, priors, and observed data, the posterior remains Gamma.

$$ L(\lambda_{gj}\mid\text{data})\propto\lambda_{gj}^{d_{gj}}\exp(-\lambda_{gj}Y_{gj}),\qquad \lambda_{gj}\mid\text{data}\sim\operatorname{Gamma}(a_{gj}+d_{gj},\,b_{gj}+Y_{gj}). $$

The likelihood is based on the event count and total time at risk, not just the number enrolled or the number censored. The posterior rate adds person-time because greater observed exposure without an event is evidence for a lower hazard.

1
Specify the analysis.
Choose the event, the fixed time \(\tau\), the interval boundaries, and the prior distributions before interpreting the results.
2
Summarize follow-up.
For each arm and interval, tabulate the observed event count \(d_{gj}\) and total at-risk person-time \(Y_{gj}\).
3
Update hazards and calculate survival.
Use the Gamma posterior for each hazard, then evaluate \(S_g(\tau)\) across posterior draws or by integrating over the posterior.
4
Compare arms at the target time.
For each paired posterior draw, calculate \(S_T(\tau)-S_C(\tau)\). The fraction of draws with a positive difference estimates the posterior probability of treatment benefit at \(\tau\).

Worked Trial: Updating the Hazards

Worked Example: Posterior Hazards From Events and Exposure

Hypothetical data. Consider a randomized trial with follow-up to 12 months and intervals 0–6 and 6–12 months. Suppose the aggregate data are as follows; person-time is in person-months.

ArmInterval (months)Events \(d_{gj}\)Person-time \(Y_{gj}\)
Control0–618540
Control6–1212300
Treatment0–612570
Treatment6–126330

Assume independent \(\operatorname{Gamma}(0.5,100)\) priors for all four hazards, with rates measured in person-months. The prior mean hazard is \(0.5/100=0.005\) per month. For control in months 0–6, the posterior is

$$ \lambda_{C1}\mid\text{data}\sim\operatorname{Gamma}(0.5+18,100+540) =\operatorname{Gamma}(18.5,640), $$

with posterior mean \(18.5/640=0.02891\) events per person-month. Applying the same update to the other intervals gives

$$ \lambda_{C2}\mid\text{data}\sim\operatorname{Gamma}(12.5,400),\quad \lambda_{T1}\mid\text{data}\sim\operatorname{Gamma}(12.5,670),\quad \lambda_{T2}\mid\text{data}\sim\operatorname{Gamma}(6.5,430). $$

The data therefore support a lower treatment-arm hazard in both intervals at the posterior-mean level. This observation alone is not a posterior probability of benefit: uncertainty in all four hazards must be carried through to survival at 12 months.

Posterior Survival at a Fixed Time

For each posterior draw of the interval hazards, survival at the target time follows directly from the model's survival function. Posterior summaries then describe uncertainty in that survival probability. In particular, the posterior mean survival is not generally the survival evaluated at the posterior mean hazards.

Result: If \(\lambda\sim\operatorname{Gamma}(a,b)\) in the shape-rate parameterization, then its Laplace transform is \(E[\exp(-c\lambda)]=(b/(b+c))^a\) for \(c\geq0\). With independent interval-specific posterior hazards, the posterior mean survival at \(\tau\) is the product of these transforms, using \(c=t_j-t_{j-1}\) for each interval.

This result follows by integrating the Gamma density. For \(c\geq0\), the density is \(b^a\lambda^{a-1}e^{-b\lambda}/\Gamma(a)\), so

$$ E[e^{-c\lambda}] =\frac{b^a}{\Gamma(a)}\int_0^\infty\lambda^{a-1}e^{-(b+c)\lambda}\,d\lambda =\frac{b^a}{\Gamma(a)}\frac{\Gamma(a)}{(b+c)^a} =\left(\frac{b}{b+c}\right)^a. $$

Independence across intervals allows the expectation of the product of survival terms to factor into the product of these expectations.

Worked Example: Mean Survival Through 12 Months

Using the posteriors above and six-month intervals, the control-arm posterior mean survival is

$$ E[S_C(12)\mid\text{data}] =\left(\frac{640}{646}\right)^{18.5} \left(\frac{400}{406}\right)^{12.5} \approx 0.6986. $$

For treatment, the corresponding calculation is

$$ E[S_T(12)\mid\text{data}] =\left(\frac{670}{676}\right)^{12.5} \left(\frac{430}{436}\right)^{6.5} \approx 0.8175. $$

Under this model and prior, the posterior mean probabilities of remaining event-free through 12 months are about 69.9% in control and 81.8% in treatment. The posterior mean absolute difference is \(0.8175-0.6986=0.1189\), or 11.9 percentage points. These are posterior summaries, not guarantees about outcomes in a future sample.

Assessing Evidence of Treatment Benefit

At the prespecified time \(\tau\), define benefit as \(S_T(\tau)>S_C(\tau)\). The posterior probability of this event is

$$ P\{S_T(\tau)>S_C(\tau)\mid\text{data}\}. $$

It is calculated by drawing hazards from their joint posterior, calculating both survival probabilities for each draw, and counting the proportion for which treatment survival is higher. Because the hazards are independent across arms under the model specified here, each arm's hazards can be drawn independently. If the analysis instead used shared parameters, their posterior dependence would need to be preserved in the draws.

Worked Example: Posterior Probability of Benefit

For the hypothetical trial above, draw 100,000 sets of hazards from the four Gamma posteriors. For each set, calculate \(S_C(12)=\exp[-6\lambda_{C1}-6\lambda_{C2}]\) and \(S_T(12)=\exp[-6\lambda_{T1}-6\lambda_{T2}]\). Suppose 97,200 draws have \(S_T(12)>S_C(12)\). The Monte Carlo estimate is

$$ \widehat{P}\{S_T(12)>S_C(12)\mid\text{data}\} =\frac{97{,}200}{100{,}000}=0.972. $$

The estimated posterior probability that treatment improves 12-month event-free survival is 97.2%. The approximate Monte Carlo standard error is \(\sqrt{0.972(1-0.972)/100{,}000}\approx0.00052\). This reflects simulation error, not all uncertainty about the model or prior. The result does not mean there is a 97.2% probability that the null hypothesis is true or false; it is a posterior probability for the stated survival comparison under the specified model.

Diagnostics, Alternatives, and Limits

A numerical posterior can be computed even when the piecewise exponential model is a poor description of the data. Useful checks include comparing observed event timing with model-implied timing within each interval, examining whether the selected boundaries conceal substantial within-interval changes, and checking that the tabulated exposure and event counts agree with participant-level follow-up. Recalculate the analysis under scientifically reasonable alternative interval boundaries and prior choices. Large changes in the fixed-time estimate or benefit probability signal that the conclusion is sensitive to modeling decisions.

Sparse events in an interval can leave its hazard strongly influenced by the prior. Conversely, using many narrow intervals can create unstable estimates, particularly when few events occur in some intervals. The model also assumes that censoring is noninformative and that the chosen event definition is consistently ascertained. If censoring depends on unobserved prognosis, the observed event and exposure summaries alone do not resolve that problem.

The fixed-time survival comparison differs from common alternatives. Kaplan–Meier estimates summarize survival nonparametrically, while a Cox proportional-hazards model summarizes a treatment contrast under a proportional-hazards structure. A piecewise exponential model instead makes a parametric assumption within chosen intervals and yields direct posterior distributions for survival at specified times. It does not require the treatment hazard ratio to be constant, but its results depend on interval choices and hazard priors. It cannot establish benefit at every time point merely from a favorable result at \(\tau\), and a fixed-time survival difference should not be described as a causal effect beyond the randomized-trial population and analysis assumptions.

A common mistake is to compare posterior mean hazards and conclude that the probability of treatment benefit equals one because each treatment-arm mean is lower. That ignores uncertainty: individual posterior draws can still have higher treatment hazards or lower treatment survival. The correction is to calculate both arms' survival in every joint posterior draw and estimate the probability of the explicitly defined comparison.

Key takeaway: Specify the event, target time, intervals, likelihood assumptions, and priors; update each interval hazard using events and person-time; then report posterior survival and the posterior probability of the fixed-time treatment comparison. Keep model uncertainty and sensitivity to the interval structure visible in the interpretation.

Check Your Understanding

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

  1. In one interval, a hypothetical arm has 8 events and 200 person-months of exposure. Under a \(\operatorname{Gamma}(1,50)\) prior, what is the posterior distribution and posterior mean hazard?
  2. Why does a censored participant contribute person-time to \(Y_{gj}\) even though no event was observed for that participant?
  3. For a one-interval model with hazard posterior \(\operatorname{Gamma}(a,b)\) and interval length \(c\), give the posterior mean survival.
  4. What posterior quantity directly assesses evidence that treatment improves survival at the prespecified time \(\tau\)?

Solutions. (1) The posterior is \(\operatorname{Gamma}(1+8,50+200)=\operatorname{Gamma}(9,250)\), with mean \(9/250=0.0360\) events per person-month. (2) The participant was known to be event-free during their observed at-risk time, so that time contributes to the exposure in the likelihood; censoring ends observation but is not itself an event. (3) The posterior mean is \(E[e^{-c\lambda}\mid\text{data}]=(b/(b+c))^a\). (4) Calculate \(P\{S_T(\tau)>S_C(\tau)\mid\text{data}\}\), typically by paired posterior draws, and interpret it as conditional on the model, priors, and observed data.

Clinical Biostats