This vignette builds on
vignette("framing", package = "retrogroup") and defines a
Bayesian survival model to guide the reconstruction. Our goal is to
construct the posterior probability of a patient belonging to a
particular subgroup level given the observed survival data and treatment
assignment. vignette("sampling", package = "retrogroup")
uses estimates of these posterior probabilities to sample subgroup
assignments for each patient. We begin by defining the hazard rate for a
proportional hazards model, then write out the likelihood, derive the
posterior probability of subgroup membership, and finally show how to
estimate it.
Notation
Along with the notation in
vignette("framing", package = "retrogroup"), define:
-
\(x_i\): the unknown subgroup level
of patient \(i\), a value in \(\{1, \ldots, K\}\).
retrogroupseeks values of \(x_1, \ldots, x_n\) that are consistent with the assumed subgroup statistics fromvignette("framing", package = "retrogroup"). - \(t\): generic value for time.
- \(z\): generic treatment indicator for an arbitrary patient.
- \(\gamma_k\): an unknown prognostic effect: the log hazard ratio of subgroup \(k > 1\) relative to the reference subgroup level \(k = 1\) for control group patients. (We define \(\gamma_1 := 0\).)
- \(\lambda_0(t)\): the baseline hazard rate at time \(t\), i.e. the hazard rate of a control patient (\(z = 0\)) in the reference subgroup level \(k = 1\).
Hazard rate
We define a proportional hazards model for the hazard rate, given a subgroup level \(k\) and treatment indicator \(z\):
\[ \lambda(t \mid k, z) := \lambda_0(t) \exp(\gamma_k + \beta_k z) \]
We will also need the cumulative hazard, defined as:
\[ \Lambda(t \mid k, z) := \int_0^t \lambda(u \mid k, z) du \]
which simplifies to:
\[ \Lambda(t \mid k, z) = \exp(\gamma_k + \beta_k z) \Lambda_0(t) \]
where the baseline cumulative hazard is defined as:
\[ \Lambda_0(t) := \int_0^t \lambda_0(u) du \]
Likelihood
We write the individual patient likelihood from Rodríguez (2010) in terms of the hazard rate above and survival function \(S(t \mid k, z)\). Unlike typical survival models, we have fixed values for \(\beta_k\), and the \(x_i\) values are the unknown parameters of interest.
\[ L(x_i \mid t_i, d_i, z_i) = \lambda(t_i \mid x_i, z_i)^{d_i} S(t_i \mid x_i, z_i) \]
Because \(S(t \mid k, z) = \exp(-\Lambda(t \mid k, z))\), we can express the likelihood in terms of the baseline hazard rate and baseline cumulative hazard:
\[ L(x_i \mid t_i, d_i, z_i) = \left[\lambda_0(t_i) \exp(\gamma_{x_i} + \beta_{x_i} z_i)\right]^{d_i} \, \exp(-\Lambda_0(t_i) \exp(\gamma_{x_i} + \beta_{x_i} z_i)) \]
This likelihood assumes that censoring is noninformative and does not depend on the subgroup level.
Posterior
Because treatment is randomized, \(x_i\) is independent of \(z_i\) a priori. Using prior \(\pi_k\) and likelihood \(L(k \mid t_i, d_i, z_i)\), Bayes’ Theorem gives the posterior probability that patient \(i\) belongs to subgroup level \(k\):
\[ P(x_i = k \mid t_i, d_i, z_i) = \frac{\pi_k L(k \mid t_i, d_i, z_i)}{\sum_{l=1}^K \pi_l L(l \mid t_i, d_i, z_i)} \]
For the prior probability of subgroup level \(k\), we use the assumed fraction of patients in that level:
\[ \pi_k := \frac{n_k}{n} \]
Every \(\pi_k\) is strictly positive
because vignette("framing", package = "retrogroup")
requires \(n_k > 0\) for every
subgroup level in the analysis.
Substituting in expressions for the likelihood and prior:
\[ P(x_i = k \mid t_i, d_i, z_i) = \frac{\frac{n_k}{n} \left[\lambda_0(t_i) \exp(\gamma_k + \beta_k z_i)\right]^{d_i} \, \exp(-\Lambda_0(t_i) \exp(\gamma_k + \beta_k z_i))}{\sum_{l=1}^K \frac{n_l}{n} \left[\lambda_0(t_i) \exp(\gamma_l + \beta_l z_i)\right]^{d_i} \, \exp(-\Lambda_0(t_i) \exp(\gamma_l + \beta_l z_i))} \]
The baseline hazard rate and total sample size cancel:
\[ P(x_i = k \mid t_i, d_i, z_i) = \frac{n_k \left[\exp(\gamma_k + \beta_k z_i)\right]^{d_i} \, \exp(-\Lambda_0(t_i) \exp(\gamma_k + \beta_k z_i))}{\sum_{l=1}^K n_l \left[\exp(\gamma_l + \beta_l z_i)\right]^{d_i} \, \exp(-\Lambda_0(t_i) \exp(\gamma_l + \beta_l z_i))} \]
Posterior probability estimation
The appendix
vignette("estimates", package = "retrogroup") gives us the
following estimates:
- \(\hat{\gamma}_k\), an estimate of the prognostic effect \(\gamma_k\) for each subgroup level \(k\).
- \(\hat{\Lambda}_0(t)\), an estimate of the baseline cumulative hazard \(\Lambda_0(t)\).
With these estimates, we can estimate the posterior probabilities of subgroup level membership. For each patient \(i\) and each potential subgroup level \(k\), we define a log-scale weight:
\[ w_{ik} := \log (n_k) + d_i \left (\hat{\gamma}_k + \beta_k z_i \right) - \hat{\Lambda}_0(t_i) \exp(\hat{\gamma}_k + \beta_k z_i) \]
We then define \(p_{ik}\) as our estimate of the posterior probability \(P(x_i = k \mid t_i, d_i, z_i)\), obtained by replacing \(\gamma_k\) and \(\Lambda_0(t_i)\) with \(\hat{\gamma}_k\) and \(\hat{\Lambda}_0(t_i)\):
\[ p_{ik} := \frac{\exp(w_{ik})}{\sum_{l=1}^K \exp(w_{il})} \]
Every \(p_{ik}\) is strictly
positive: because \(n_k > 0\), each
\(w_{ik}\) is finite, so each \(\exp(w_{ik})\) is positive. In floating
point arithmetic, a positive \(p_{ik}\)
can still be numerically indistinguishable from zero, so
retrogroup throws an error if any \(p_{ik}\) is less than the square root of
machine epsilon.
Given \(\hat{\gamma}_k\) and \(\hat{\Lambda}_0(t_i)\), each \(p_{ik}\) is available in closed form. Its
only inputs are the survival data and the assumed values of \(n_k\), \(e_k\), and \(\beta_k\) from
vignette("framing", package = "retrogroup"), and computing
it requires no model fitting beyond the root finding and running sum in
vignette("estimates", package = "retrogroup"). These \(p_{ik}\) values are what
vignette("sampling", package = "retrogroup") uses to sample
subgroup assignments.
