Tutorials › Bayesian Clinical Trials › Posterior Inference for Median Survival

Posterior Inference for Trial Endpoints · Tutorial 25 of 696

Posterior Inference for Median Survival

Learn how to transform a Gamma posterior for an exponential hazard into inference about median survival, including credible intervals, moments and clinically interpretable probabilities.

Beginner 11 min read

What You'll Learn

  • Derive the median survival time from a constant exponential hazard.
  • Transform a Gamma posterior for the hazard to the posterior distribution of median survival.
  • Calculate posterior means, credible intervals and probabilities on the survival-time scale.
  • Explain why uncertainty becomes asymmetric after the transformation.
  • Check the model assumptions and recognize when posterior moments do not exist.

Why Infer Median Survival?

A hazard is expressed in inverse-time units, while median survival is expressed in time units. The two quantities describe the same exponential survival model from different perspectives: the hazard is the instantaneous event rate, and the median is the time by which the model assigns a survival probability of one half. In a clinical trial, median survival can be easier to communicate clinically, but its uncertainty must be calculated from the posterior distribution rather than by simply transforming a point estimate and keeping the same uncertainty measure.

The introductory material on posterior survival probability at a fixed time considers uncertainty in \(S(t)\), the probability of surviving beyond a specified time \(t\). Here the target is different: the time \(m\) at which the survival curve reaches one half. We derive its full posterior distribution from the posterior for the hazard.

Exponential Median and Model Conditions

Definition: Under an exponential event-time model with constant hazard \(\lambda>0\), the survival function is \(S(t\mid\lambda)=\exp(-\lambda t)\) for \(t\geq 0\). The model median survival time \(M\) is the positive time satisfying \(S(M\mid\lambda)=0.5\), so \(M=\log(2)/\lambda\).

The exponential model assumes that, conditional on \(\lambda\), the event-time hazard is constant over follow-up. It also assumes the event times for different participants are conditionally independent under the model. With right-censored observations, the censoring mechanism must be non-informative for the event-time analysis: after accounting for the model, censoring must not convey additional information about a participant’s event time. These assumptions may be unsuitable when the hazard changes substantially over time or when censoring is informative.

Suppose the posterior distribution for the hazard, after combining the prior and trial data, is \(\lambda\mid\text{data}\sim\operatorname{Gamma}(a,b)\), using the shape-rate parameterization. Thus \(a>0\), \(b>0\), and the density is proportional to \(\lambda^{a-1}\exp(-b\lambda)\). The hazard has units of inverse time, so \(b\) has units of time. We treat \(a\) and \(b\) as fixed posterior parameters in the transformation below.

Transforming the Hazard Posterior

Because \(M=\log(2)/\lambda\) decreases as \(\lambda\) increases, a large hazard corresponds to a short median survival time, and vice versa. This reversal matters for both probabilities and credible-interval endpoints. Write \(c=\log(2)\). For any \(m>0\),

$$ P(M\leq m\mid\text{data}) =P\left(\frac{c}{\lambda}\leq m\mid\text{data}\right) =P\left(\lambda\geq\frac{c}{m}\mid\text{data}\right) =1-F_{\lambda\mid\text{data}}\left(\frac{c}{m}\right), $$

where \(F_{\lambda\mid\text{data}}\) is the posterior cumulative distribution function of the hazard. The inequality reverses because \(\lambda\) is positive and \(c/\lambda\) is decreasing in \(\lambda\). This formula determines the entire posterior distribution of median survival.

The density follows by the change-of-variables rule. Since \(\lambda=c/m\), the absolute derivative is \(|d\lambda/dm|=c/m^2\). Multiplying the Gamma density evaluated at \(c/m\) by this Jacobian gives

$$ f_{M\mid\text{data}}(m) =\frac{(bc)^a}{\Gamma(a)}m^{-(a+1)} \exp\left(-\frac{bc}{m}\right),\qquad m>0. $$

This is an inverse-Gamma distribution with shape \(a\) and scale \(bc\). The derivation uses only the posterior for \(\lambda\) and the deterministic relationship between \(\lambda\) and \(M\); no additional sampling approximation is needed.

Key result: If \(\lambda\mid\text{data}\sim\operatorname{Gamma}(a,b)\) in the shape-rate convention, then \(M=\log(2)/\lambda\) has an inverse-Gamma posterior with shape \(a\) and scale \(b\log(2)\). Its posterior \(q\)-quantile is \(Q_M(q)=\log(2)/Q_\lambda(1-q)\). The order is reversed because the transformation is decreasing.

Posterior Summaries and Credible Intervals

The posterior mean of median survival exists only if \(a>1\). When it exists, it is

$$ E(M\mid\text{data}) =\log(2)E\left(\frac{1}{\lambda}\mid\text{data}\right) =\frac{b\log(2)}{a-1},\qquad a>1. $$

For \(a>2\), the posterior variance also exists and is

$$ \operatorname{Var}(M\mid\text{data}) =\frac{[b\log(2)]^2}{(a-1)^2(a-2)}. $$

These existence conditions arise because the inverse-Gamma density has a long right tail: when the hazard is very close to zero, its corresponding median survival is very large. If \(a\leq1\), the posterior mean of \(M\) is infinite; if \(1<a\leq2\), the mean exists but the variance is infinite. A finite posterior mean is therefore not guaranteed simply because the hazard posterior is proper.

To obtain an equal-tailed \(100(1-\alpha)\%\) credible interval for \(M\), first find the \(\alpha/2\) and \(1-\alpha/2\) quantiles of the hazard posterior. The lower endpoint for \(M\) comes from the upper hazard quantile:

$$ \left[ \frac{\log(2)}{Q_\lambda(1-\alpha/2)}, \frac{\log(2)}{Q_\lambda(\alpha/2)} \right]. $$

Conditional on the model and data, this interval contains the unknown model median with posterior probability \(1-\alpha\). Since the transformation is nonlinear, the interval will generally be asymmetric around a posterior point summary. Transforming the endpoints correctly is essential; retaining their original order would produce an invalid interval.

Worked Example: Transforming a Gamma Posterior

Suppose a hypothetical trial analysis gives a hazard posterior \(\lambda\mid\text{data}\sim\operatorname{Gamma}(3,2)\), with \(\lambda\) measured per month and the Gamma rate parameter \(b=2\) months. Calculate the posterior mean and a 95% equal-tailed credible interval for median survival.

Here \(a=3>1\), so the posterior mean exists. Substitution gives

$$ E(M\mid\text{data}) =\frac{2\log(2)}{3-1} =\frac{2(0.6931)}{2} =0.6931\text{ months}. $$

For a 95% equal-tailed interval, the approximate 0.025 and 0.975 quantiles of the hazard posterior are \(0.3093\) and \(3.612\) per month. Applying the reversed quantile order gives

$$ \left[ \frac{0.6931}{3.612}, \frac{0.6931}{0.3093} \right] =[0.1919,\ 2.241]\text{ months}. $$

Thus the posterior probability that the model median survival is between about 0.192 and 2.24 months is 0.95. The interval is not symmetric around the posterior mean of 0.693 months. That is expected: small hazard values map to very large median survival times, stretching the right tail.

Worked Trial-Data Update

For independent exponential event times with right censoring, let \(d\) be the number of observed events and let \(T\) be the total observed follow-up time across participants. Under the constant-hazard model and non-informative censoring, the likelihood for \(\lambda\) is proportional to \(\lambda^d\exp(-\lambda T)\). With a Gamma prior \(\operatorname{Gamma}(a_0,b_0)\) in the shape-rate convention, the posterior is \(\operatorname{Gamma}(a_0+d,b_0+T)\). The example applies this update and then transforms the resulting posterior to median survival.

Worked Example: Right-Censored Follow-Up and Median Survival

In a hypothetical trial arm, eight participants contribute 24 person-months of total follow-up, with five observed events and three right-censored observations. Suppose the prior for the constant hazard is \(\operatorname{Gamma}(2,1)\), where the rate parameter is in months. Assume independent event times conditional on the hazard and non-informative censoring. What is the posterior mean and 95% equal-tailed credible interval for median survival?

The posterior shape is the prior shape plus the number of events, and the posterior rate is the prior rate plus total follow-up:

$$ a=2+5=7,\qquad b=1+24=25, \qquad \lambda\mid\text{data}\sim\operatorname{Gamma}(7,25). $$

The median-survival posterior mean exists because \(a=7>1\). Its value is

$$ E(M\mid\text{data}) =\frac{25\log(2)}{7-1} =\frac{25(0.6931)}{6} =2.888\text{ months}. $$

The approximate 0.025 and 0.975 hazard quantiles are \(0.1126\) and \(0.5224\) per month. Reverse their order when transforming:

$$ \left[ \frac{0.6931}{0.5224}, \frac{0.6931}{0.1126} \right] =[1.327,\ 6.156]\text{ months}. $$

Under this model and posterior, the 95% credible interval for median survival is about 1.33 to 6.16 months. The interval is wide relative to the posterior mean, reflecting uncertainty and right skew on the survival-time scale. The numerical calculation presumes the stated exponential and censoring assumptions; the conjugate update does not make those assumptions true.

Probabilities and Interpretation on the Time Scale

The transformed distribution also answers questions about clinically meaningful thresholds. For a threshold \(t_0>0\), the posterior probability that the model median exceeds \(t_0\) is

$$ P(M>t_0\mid\text{data}) =P\left(\lambda<\frac{\log(2)}{t_0}\mid\text{data}\right) =F_{\lambda\mid\text{data}}\left(\frac{\log(2)}{t_0}\right). $$

This is a posterior probability about the parameter \(M\), not the probability that a particular participant survives beyond \(t_0\). The latter is \(S(t_0\mid\lambda)\) for a specified hazard, or a posterior distribution for \(S(t_0\mid\lambda)\) when the hazard is uncertain. Keeping the parameter target distinct from an individual event-time probability avoids a common interpretive error.

Worked Example: Probability Median Survival Exceeds a Threshold

Use the hypothetical posterior \(\lambda\mid\text{data}\sim\operatorname{Gamma}(3,2)\) from the earlier numerical calculation. Find the posterior probability that median survival exceeds 0.5 months.

First convert the threshold to its corresponding hazard cutoff:

$$ \frac{\log(2)}{0.5}=1.3863\text{ per month}. $$

For a Gamma distribution with shape 3 and rate 2, the CDF at \(x\) is \(1-\exp(-2x)[1+2x+(2x)^2/2]\). Therefore,

$$ P(M>0.5\mid\text{data}) =1-\exp(-2(1.3863)) \left[1+2(1.3863)+\frac{(2(1.3863))^2}{2}\right] \approx 0.5240. $$

The posterior probability that the model median exceeds 0.5 months is approximately 52.4%. The result follows from the hazard CDF at the transformed cutoff; it is not a statement that an individual participant has a 52.4% probability of surviving past 0.5 months.

Diagnostics, Alternatives, and Limitations

The transformation is exact for the exponential model, but it does not protect the analysis from model failure. Before interpreting the median, examine whether a constant hazard is plausible over the trial’s follow-up. Strong time variation, such as an early high hazard followed by a lower hazard, makes a single exponential median an inadequate summary of the survival pattern. Also investigate whether censoring could depend on prognosis after accounting for the model; informative censoring can undermine the likelihood and posterior update.

A practical diagnostic is to compare the exponential survival curve implied by the fitted hazard with the observed event and censoring pattern over time. Marked systematic departures, especially across clinically meaningful follow-up periods, are a warning that the constant-hazard assumption may not describe the data well. Sparse events can also leave the posterior sensitive to the prior, particularly near zero hazard, where very long median times occur. Report the prior and assess whether plausible alternative priors materially change the transformed interval or threshold probability.

The main alternative summaries answer different questions. A posterior interval for the hazard is natural for rate-based decisions, but it is not an interval on the time scale. A posterior survival probability at a fixed time describes survival beyond that time, rather than the time at which survival reaches one half. A median is clinically direct under an exponential model, but it compresses the survival curve to one number and may conceal changes in hazard over time. The transformation also produces a long-tailed posterior: a small amount of posterior probability near zero hazard can substantially increase the mean or make it infinite.

Common pitfall: Transforming the lower hazard credible limit into the lower median-survival limit is wrong. Because \(M=\log(2)/\lambda\) decreases with \(\lambda\), the lower median-survival endpoint is \(\log(2)\) divided by the upper hazard endpoint. Similarly, a posterior mean for the hazard cannot simply be inverted to obtain the posterior mean median survival; in general \(E(1/\lambda\mid\text{data})\ne1/E(\lambda\mid\text{data})\).

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. If \(\lambda=0.2\) per month in an exponential model, what is the model median survival time?
  2. If \(\lambda\mid\text{data}\sim\operatorname{Gamma}(4,10)\) in the shape-rate convention, what is the posterior mean of \(M\), and does it exist?
  3. For a 90% equal-tailed interval for \(M\), which hazard quantiles determine the lower and upper endpoints?
  4. For \(\lambda\mid\text{data}\sim\operatorname{Gamma}(1,3)\), is the posterior mean median survival finite? Explain.

Solutions. 1. \(M=\log(2)/0.2=3.466\) months. 2. Here \(a=4>1\), so the mean exists: \(E(M\mid\text{data})=10\log(2)/(4-1)=2.310\) months. 3. The lower endpoint uses the 0.95 hazard quantile and the upper endpoint uses the 0.05 hazard quantile: \([\log(2)/Q_\lambda(0.95),\log(2)/Q_\lambda(0.05)]\). 4. The mean is not finite because the Gamma shape is \(a=1\), and the inverse-Gamma posterior mean exists only when \(a>1\).

Clinical Biostats