Tutorials › Bayesian Clinical Trials › Posterior Hazard Ratios for Two Exponential Trial Arms

Posterior Inference for Trial Endpoints · Tutorial 26 of 696

Posterior Hazard Ratios for Two Exponential Trial Arms

Learn how to transform two independent gamma hazard posteriors into a posterior hazard-ratio distribution and interpret it alongside arm-specific survival.

Beginner 10 min read

What You'll Learn

  • State the exponential-arm model and the assumptions needed for independent gamma posterior updates.
  • Derive the treatment-to-control hazard-ratio distribution using a beta transformation.
  • Calculate posterior probabilities and equal-tailed credible intervals for a hazard ratio.
  • Distinguish summaries of a hazard ratio from posterior survival summaries for each arm.
  • Identify diagnostics and limitations of the constant-hazard, independent-arm analysis.

From Arm-Specific Hazards to a Hazard Ratio

A trial comparison is often summarized by a hazard ratio, but that ratio is a derived quantity: uncertainty in both arm-specific hazards contributes to uncertainty in their ratio. With exponential event times and independent gamma posteriors for the two hazards, the ratio has a tractable posterior distribution. This makes it possible to calculate probabilities such as the posterior probability that the treatment hazard is lower than the control hazard, rather than comparing only two point estimates.

Let \(\lambda_T\) and \(\lambda_C\) denote the treatment-arm and control-arm event hazards, respectively. In this tutorial the hazard ratio is defined as treatment divided by control, \(HR=\lambda_T/\lambda_C\). Thus \(HR<1\) corresponds to a lower instantaneous event hazard in the treatment arm under the model. Hazards have units of inverse time, while the ratio is dimensionless.

Model and assumptions: In arm \(j\), where \(j\) is \(T\) or \(C\), event times follow an exponential model with constant hazard \(\lambda_j>0\). Given the arm-specific data, the likelihood is proportional to \(\lambda_j^{d_j}\exp(-\lambda_jY_j)\), where \(d_j\) is the number of observed events and \(Y_j\) is the total observed time at risk. Censoring is assumed non-informative for the event time, and the likelihood contributions from the two arms are independent. The prior hazards are independent, with \(\lambda_j\sim\operatorname{Gamma}(a_{j0},b_{j0})\), using a shape-rate parameterization. These assumptions give independent gamma posteriors.

In this parameterization, a \(\operatorname{Gamma}(a,b)\) distribution has density proportional to \(\lambda^{a-1}e^{-b\lambda}\), mean \(a/b\), and rate \(b\). Combining this prior with the likelihood gives \( \lambda_j\mid D_j\sim\operatorname{Gamma}(a_j,b_j)\), where \(a_j=a_{j0}+d_j\) and \(b_j=b_{j0}+Y_j\). The posterior rate has units of time, so \(a_j/b_j\) has units of inverse time.

Deriving the Posterior Distribution of the Ratio

A ratio of independent gamma variables is not generally another gamma variable. A useful transformation instead converts it to a scaled beta-prime ratio. Define \(U=b_T\lambda_T\) and \(V=b_C\lambda_C\). Under the independent posteriors, \(U\sim\operatorname{Gamma}(a_T,1)\) and \(V\sim\operatorname{Gamma}(a_C,1)\), independently. The sum-and-proportion property of independent unit-rate gamma variables gives \(Q=U/(U+V)\sim\operatorname{Beta}(a_T,a_C)\).

$$ HR=\frac{\lambda_T}{\lambda_C} =\frac{b_C}{b_T}\frac{U}{V} =\frac{b_C}{b_T}\frac{Q}{1-Q}, \qquad Q\sim\operatorname{Beta}(a_T,a_C). $$

This transformation supplies the complete posterior distribution of \(HR\). For any positive value \(h\), set \(q_h=h b_T/(b_C+h b_T)\). Since the transformation from \(Q\) to \(HR\) is increasing, \(P(HR\le h\mid D)=P(Q\le q_h\mid D)\). In particular, the posterior probability that the treatment hazard is lower than the control hazard is the beta cumulative probability at \(q_1=b_T/(b_T+b_C)\).

$$ P(HR<1\mid D) = P\left(Q<\frac{b_T}{b_T+b_C}\mid D\right). $$

If \(q_L\) and \(q_U\) are the lower and upper quantiles of the \(\operatorname{Beta}(a_T,a_C)\) posterior, then a central equal-tailed \(100(1-\gamma)\%\) credible interval for the hazard ratio is \(\bigl((b_C/b_T)q_L/(1-q_L),\ (b_C/b_T)q_U/(1-q_U)\bigr)\), where \(q_L\) and \(q_U\) are the \(\gamma/2\) and \(1-\gamma/2\) beta quantiles. This is a posterior interval: conditional on the model and data, it contains the hazard ratio with posterior probability \(1-\gamma\).

Worked Example: Updating Two Arms and Calculating a Posterior Probability

Suppose, hypothetically, that each arm has an independent \(\operatorname{Gamma}(1,0.1)\) prior, with time measured in years. The treatment arm has 1 observed event over 11.9 person-years; the control arm has 1 event over 9.9 person-years. Assume the exponential model and non-informative censoring are appropriate.

The posterior parameters are \(a_T=1+1=2\), \(b_T=0.1+11.9=12\) years, \(a_C=1+1=2\), and \(b_C=0.1+9.9=10\) years. Thus \(\lambda_T\mid D\sim\operatorname{Gamma}(2,12)\) and \(\lambda_C\mid D\sim\operatorname{Gamma}(2,10)\), with rates expressed in years.

Here \(Q\sim\operatorname{Beta}(2,2)\), whose cumulative distribution function is \(F(q)=3q^2-2q^3\) for \(0\le q\le1\). For \(HR<1\), the required beta cutoff is \(12/(12+10)=6/11\). Therefore,

$$ P(HR<1\mid D) =3\left(\frac{6}{11}\right)^2-2\left(\frac{6}{11}\right)^3 =\frac{756}{1331} \approx 0.5680. $$

The posterior probability that the treatment hazard is lower is about 56.8%. This is not a probability that a null hypothesis is true; it is a posterior probability about the hazards under the specified model and priors.

Credible Intervals and Arm-Specific Survival

For the same hypothetical data, the equal-tailed 95% quantiles of \(\operatorname{Beta}(2,2)\) are approximately \(q_L=0.0943\) and \(q_U=0.9057\). Since \(b_C/b_T=10/12\), transforming both endpoints gives:

$$ HR_L=\frac{10}{12}\frac{0.0943}{1-0.0943} \approx 0.0868, \qquad HR_U=\frac{10}{12}\frac{0.9057}{1-0.9057} \approx 8.00. $$

The 95% equal-tailed posterior credible interval is approximately 0.0868 to 8.00. It is wide and includes 1, reflecting substantial uncertainty about the relative hazards. Its asymmetry is natural for a positive ratio; an interval for \(HR\) need not be centered on a point estimate.

The ratio does not replace arm-specific survival summaries. Under an exponential model, survival at time \(t\) is \(S_j(t)=\exp(-\lambda_jt)\). With a gamma posterior, its posterior mean is the Laplace transform of that gamma distribution:

$$ E\{S_j(t)\mid D_j\} =E\{\exp(-\lambda_jt)\mid D_j\} =\left(\frac{b_j}{b_j+t}\right)^{a_j}. $$

This posterior mean is not obtained by simply substituting the posterior mean hazard into the survival function. In general, \(E\{\exp(-\lambda_jt)\mid D_j\}\ne\exp[-E(\lambda_j\mid D_j)t]\). The following example shows both arm-specific survival summaries and how they complement a hazard-ratio summary.

Worked Example: Posterior Survival in Each Arm

Consider a second hypothetical trial, with time measured in years. Suppose the arm-specific posteriors are \(\lambda_T\mid D\sim\operatorname{Gamma}(9,120.1)\) and \(\lambda_C\mid D\sim\operatorname{Gamma}(11,100.1)\). For example, these could result from independent \(\operatorname{Gamma}(2,0.1)\) priors and event/exposure data of 7 events over 120 person-years in treatment and 9 events over 100 person-years in control.

At \(t=1\) year, the treatment-arm posterior mean survival is \((120.1/(120.1+1))^9=(120.1/121.1)^9\approx0.9281\). For the control arm it is \((100.1/(100.1+1))^{11}=(100.1/101.1)^{11}\approx0.8964\).

Under these assumptions, the posterior mean survival at one year is about 92.8% in treatment and 89.6% in control. These are separate marginal summaries, not a posterior interval for a survival difference and not a direct calculation of the hazard-ratio probability. The posterior mean hazards are \(9/120.1\approx0.07494\) per year and \(11/100.1\approx0.1099\) per year, respectively. Their ratio is a ratio of posterior means, not the posterior mean of the ratio.

Posterior Summaries, Diagnostics, and Limitations

The posterior distribution can be summarized in several ways. A posterior probability such as \(P(HR<1\mid D)\) directly answers a directional question. A credible interval describes a range of plausible ratio values and their posterior probability. A posterior mean or median gives a single summary, but should not obscure skewness or a long upper tail.

The posterior mean of \(HR\) exists only if \(a_C>1\), because the inverse of a \(\operatorname{Gamma}(a_C,b_C)\) variable has a finite expectation only under that condition. When it exists, independence gives:

$$ E(HR\mid D) =E(\lambda_T\mid D)E(1/\lambda_C\mid D) =\frac{a_T}{b_T}\frac{b_C}{a_C-1}. $$

For example, in the second hypothetical trial this mean is \((9/120.1)(100.1/10)\approx0.7501\). This number is not the ratio of posterior mean hazards, which is approximately \(0.07494/0.1099\approx0.682\). A ratio posterior can be highly skewed, and the two summaries answer different questions. If \(a_C\le1\), the posterior mean ratio is infinite or undefined, though posterior probabilities and finite quantiles remain well-defined.

A practical check is to compare the implied hazards and survival summaries with the clinical time scale and observed event/exposure information. An implausibly high hazard, a survival curve inconsistent with the event pattern, or a ratio interval spanning many orders of magnitude should prompt checks of units, event counts, exposure totals, prior parameters, and computation. Sparse events can produce wide or prior-sensitive posteriors. The exponential model also imposes a constant hazard over follow-up; systematic time patterns in observed event timing may make that assumption unsuitable. Independent-arm posteriors further rely on independent priors and arm-separated likelihoods, so shared parameters or informative dependencies require a different model.

For numerical work, the beta transformation provides a direct route to probabilities and quantiles. Another valid approach is to draw posterior samples independently from the two gamma distributions, divide each treatment draw by its paired control draw, and summarize the resulting ratios. Simulation is flexible, but introduces Monte Carlo error; the beta transformation is an exact distributional result for these independent gamma posteriors. Comparing arm-specific hazards alone is not a substitute for either method, because it does not quantify posterior uncertainty in their ratio.

Justification of the Beta Transformation

1
Rescale each hazard.
If \(\lambda_T\sim\operatorname{Gamma}(a_T,b_T)\), then \(U=b_T\lambda_T\sim\operatorname{Gamma}(a_T,1)\); similarly \(V=b_C\lambda_C\sim\operatorname{Gamma}(a_C,1)\). Independence is preserved by these separate rescalings.
2
Separate the sum and proportion.
For independent unit-rate gamma variables with shapes \(a_T\) and \(a_C\), the change of variables from \((U,V)\) to \((U+V,Q=U/(U+V))\) factors the joint density into a gamma density for the sum and a beta density for \(Q\). Hence \(Q\sim\operatorname{Beta}(a_T,a_C)\).
3
Transform the proportion into the ratio.
Since \(U/V=Q/(1-Q)\), substitution of \(U=b_T\lambda_T\) and \(V=b_C\lambda_C\) yields \(HR=(b_C/b_T)Q/(1-Q)\). The transformation is increasing for \(0<Q<1\), so beta probabilities and quantiles transform directly.

Common Pitfalls

  • Reversing the ratio. If the stated estimand is treatment divided by control, the scale factor is \(b_C/b_T\), not \(b_T/b_C\). Write the ratio explicitly before transforming.
  • Using only posterior mean hazards. The ratio of two posterior means is not generally the posterior mean or median of their ratio. Use the ratio posterior distribution for uncertainty statements.
  • Calling a credible interval a confidence interval. The interval here has a posterior probability interpretation conditional on the model, prior, and data; it is not a repeated-sampling coverage statement.
  • Reading \(HR<1\) as a survival probability statement. It indicates a lower constant event hazard in treatment under the exponential model. It does not by itself give the magnitude or uncertainty of a survival difference at a chosen time.
  • Ignoring model fit and censoring. Gamma conjugacy does not make the exponential or non-informative censoring assumptions true. Check the time scale and censoring mechanism before relying on the posterior comparison.
Key takeaway: With independent \(\operatorname{Gamma}(a_T,b_T)\) and \(\operatorname{Gamma}(a_C,b_C)\) posteriors, the treatment-to-control hazard ratio is \((b_C/b_T)Q/(1-Q)\), where \(Q\sim\operatorname{Beta}(a_T,a_C)\). Use that distribution for ratio probabilities and intervals, and report arm-specific survival summaries separately when they answer the clinical question.

Check Your Understanding

Answer each question, then check the solutions below.

  1. If the treatment and control posteriors are \(\operatorname{Gamma}(3,8)\) and \(\operatorname{Gamma}(4,10)\), respectively, what beta distribution and scale factor determine the treatment-to-control hazard ratio?
  2. For the posteriors in Question 1, write the beta cutoff that gives \(P(HR<1\mid D)\).
  3. In the worked example with \(\operatorname{Beta}(2,2)\), why does a posterior probability \(P(HR<1\mid D)\) of about 0.5680 not mean there is a 56.8% probability that the null hypothesis is true?
  4. When is the posterior mean of the treatment-to-control hazard ratio finite?

Solutions. (1) \(Q\sim\operatorname{Beta}(3,4)\), and \(HR=(10/8)Q/(1-Q)\). (2) The cutoff is \(b_T/(b_T+b_C)=8/(8+10)=4/9\), so the probability is the \(\operatorname{Beta}(3,4)\) cumulative probability at \(4/9\). (3) It is a posterior probability for the parameter inequality \(HR<1\), conditional on the model, prior, and data; it is not a probability assigned to a point null hypothesis. (4) The posterior mean is finite when the control-arm gamma shape satisfies \(a_C>1\), since the ratio contains \(1/\lambda_C\).

Clinical Biostats