Methods

library(historicalborrow)

This vignette defines the models and historical borrowing metrics supported in the historicalborrow package.

Models

Common notation

  • y: vector of patient-specific clinical responses to a continuous outcome variable. Ideally, the outcome variable should be some form of change from baseline, not the response itself. If the outcome is the raw response, then the treatment effect will not be meaningful.
  • yij: the element of y corresponding to study i patient j.
  • (X)ij: the row of matrix X corresponding to study i patient j.
  • α: Vector of control group mean parameters, one for each study. The first elements are for the historical studies, and the last one is for the current study.
  • δ: Vector of study-specific treatment mean parameters. There is one for each combination of study and non-control treatment group.
  • d: integer index for the elements of δ.
  • b: integer index for the elements of β.
  • β: Vector of study-specific baseline covariate parameters.
  • Xα: matrix for the control group mean parameters α. It has indicator columns to select the appropriate element of α for each element of y.
  • Xδ: matrix for the treatment mean parameters δ. It has indicator columns to select the appropriate element of δ for each element of y.
  • Xβ: matrix for the baseline covariate fixed effect parameters β. It has indicator columns to select the appropriate element of β for each element of y.
  • σ: Vector of study-specific residual standard deviations.
  • I(⋅): indicator function.

Model matrices

Each primary model is parameterized thus:

$$ \begin{aligned} E(y) = X_\alpha \alpha + X_\delta \delta + X_\beta \beta \end{aligned} $$

Above, Xα, Xδ, and Xβ are fixed matrices. Xβ is a conventional model matrix for the baseline covariates β, and the details are explained in the “Baseline covariates” section below. Xα is a matrix of zeroes and ones. It is constructed such that each scalar component of α is the mean response of the control group in a particular study. Likewise, Xδ is a matrix of zeroes and ones such that each scalar component of δ is the mean response of a non-control treatment group in a particular study.

To illustrate, let yijk be patient i in treatment group j (where j = 1 is the control group) of study k, and let (Xββ)ijk be the corresponding scalar element of the vector Xββ. Then,

$$ \begin{aligned} E(y_{ijk}) = I (j = 1) \alpha_{k} + I (j > 1) \delta_{jk} + \left ( X_\beta \beta \right )_{ijk} \end{aligned} $$

This parameterization is represented in the more compact expression Xαα + Xδδ + Xββ in the model definitions in this vignette.

Baseline covariates

The baseline covariates model matrix Xβ adjusts for baseline covariates. It may contain a continuous column for baseline and binary indicator columns for the levels of user-defined covariates. All these columns are included if possible, but the method automatically drops baseline covariate columns to ensure that the combined model matrix Xi* = [Xα*  Xδ*  Xβ*]i is full rank. (Here, Xi* denotes the rows of matrix X corresponding to study i, with additional rows dropped if the corresponding elements of y are missing. The additional row-dropping based on the missingness of y ensures identifiability even when the user supplies complicated many-leveled factors as covariates.) The choice of columns to drop from Xβi is determined by the rank and pivoting strategy of the QR decomposition of Xi using the Householder algorithm with pivoting (base::qr(), LINPACK routine DQRDC).

Separately within each study, each column of Xβ is centered to have mean 0, and if possible, scaled to have variance 1. Scaling ensures that the priors on parameters β remain relatively diffuse relative to the input data. Study-level centering ensures that the α parameters truly act as unconditional study-specific control group means (as opposed to conditional on the subset of patients at the reference level of Xβ), and it ensures that borrowing across α components fully presents as control group borrowing.

Post-processing

The hb_summary() function post-processes the results from the model. It accepts MCMC samples of parameters and returns estimated marginal means of the response and treatment effect. To estimate marginal means of the response, hb_summary() takes group-level averages of posterior samples of fitted values while dropping covariate adjustment terms from the model (i.e. Xαα + Xδδ). Because the columns of Xβ are centered at their means, this choice is mathematically equivalent to emmeans::emmeans() with the weights = "proportional" (Lenth (2016)).

Mixture model

Functions:

  • hb_sim_mixture()
  • hb_mcmc_mixture()

The mixture model analyzes only the data from the current study, so we use Xαmixture instead of Xα. Xαmixture is a one-column matrix to indicate which elements of y are part of the control group of the current study.

The historical studies contribute to the model through hyperparameters (mω)i and (sω)i. If study i is a historical study, (mω)i and (sω)i are the posterior mean and posterior standard deviation, respectively, of the mean control group response estimated from the simple model described later. If study i is the current study, (mω)i and (sω)i are chosen so the mixture component Normal((mω)i, (sω)i) of study i is diffuse and non-informative. Variable ωi of study i is the latent variable of mixture component i, and the index variable π chooses which ωi to use for the current study control group mean α. Hyperparameter pω is a constant vector of prior mixture proportions of each study. The posterior histogram of π gives the posterior mixture proportions.

$$ \begin{aligned} & y_{ij} \stackrel{\text{ind}}{\sim} \text{N} \left ( \left (X_\alpha^{\text{mixture}} \alpha + X_\delta \delta + X_\beta \beta \right )_{ij}, \ \sigma^2 \right) \\ & \qquad \alpha = \omega_{\pi} \\ & \qquad \qquad \omega_i \stackrel{\text{ind}}{\sim} \text{Normal}(({m_\omega})_i, (s_\omega)_i^2) \\ & \qquad \qquad \pi \sim \text{Categorical}(p_\omega) \\ & \qquad \delta_d \stackrel{\text{ind}}{\sim} \text{Normal} (0, s_\delta^2) \\ & \qquad \beta_b \sim \text{Normal} (0, s_\beta^2) \\ & \qquad \sigma \sim \text{Uniform}(0, s_\sigma) \end{aligned} $$

Hierarchical model

Functions:

  • hb_sim_hierarchical()
  • hb_mcmc_hierarchical()
  • hb_s_tau()

The hierarchical model is equivalent to the meta-analytic combined (MAC) approach analyzes the data from all studies and shrinks the control group means αi towards a common normal distribution with mean μ and variance τ2.

$$ \begin{aligned} & y_{ij} \sim \text{N} \left( \left (X_\alpha \alpha + X_\delta \delta + X_\beta \beta \right )_{ij} , \ \sigma_i^2 \right )\\ & \qquad \alpha_i \stackrel{\text{ind}}{\sim} \text{Normal}(\mu, \tau^2) \\ & \qquad \qquad \mu \sim \text{Normal}(0, s_\mu^2) \\ & \qquad \qquad \tau \sim f_\tau \\ & \qquad \delta_d \stackrel{\text{ind}}{\sim} \text{Normal} (0, s_\delta^2) \\ & \qquad \beta_b \stackrel{\text{ind}}{\sim} \text{Normal} (0, s_\beta^2) \\ & \qquad \sigma_i \stackrel{\text{ind}}{\sim} \text{Uniform}(0, s_\sigma) \end{aligned} $$

The prior fτ on τ is critically important because:

  1. It controls the prior amount of borrowing, and
  2. The prior has a large influence if there are few historical studies in the data.

fτ can either be a flexible half-Student-t distribution with dτ degrees of freedom and scale parameter sτ:

fτ = Student-t(0, sτ, dτ)+ or a uniform distribution with lower bound 0 and upper bound sτ:

fτ = Uniform(0, sτ)

Following the recommendation of Gelman (2006), please use half-Student-t if the number of historical studies is small and consider uniform for large numbers of historical studies.

For the half-Student-t distribution, the role of the sτ parameter is equivalent to the σ parameter from the Student-t parameterization in the Stan user manual.

Independent model

Functions:

  • hb_sim_independent()
  • hb_mcmc_independent()

The independent model is the same as the hierarchical model, but with independent control group parameters α. We use it as a no-borrowing benchmark to quantify the borrowing strength of the hierarchical model and the mixture model.

$$ \begin{aligned} & y_{ij} \sim \text{N} \left( \left (X_\alpha \alpha + X_\delta \delta + X_\beta \beta \right )_{ij} , \ \sigma_i^2 \right )\\ & \qquad \alpha_i \stackrel{\text{ind}}{\sim} \text{Normal}(0, s_\alpha^2) \\ & \qquad \delta_d \stackrel{\text{ind}}{\sim} \text{Normal} (0, s_\delta^2) \\ & \qquad \beta_b \stackrel{\text{ind}}{\sim} \text{Normal} (0, s_\beta^2) \\ & \qquad \sigma_i \stackrel{\text{ind}}{\sim} \text{Uniform}(0, s_\sigma) \end{aligned} $$

Pooled model

Functions:

  • hb_sim_pool()
  • hb_mcmc_pool()

Like the independent model, the pooled model is a benchmark to quantify the borrowing strength of the hierarchical model and the mixture model. But instead of the no-borrowing independent model, the pooled model represents maximum borrowing. Instead of Xα, below, we use Xαpool, which has only one column to indicate which observations belong to any control group. In other words, the α parameters are pooled, and α itself is a scalar.

$$ \begin{aligned} & y_{ij} \sim \text{N} \left( \left ( X_\alpha^{\text{pool}} \alpha + X_\delta \delta + X_\beta \beta \right )_{ij} , \ \sigma_i^2 \right )\\ & \qquad \alpha \sim \text{Normal}(0, s_\alpha^2) \\ & \qquad \delta_d \stackrel{\text{ind}}{\sim} \text{Normal} (0, s_\delta^2) \\ & \qquad \beta_b \stackrel{\text{ind}}{\sim} \text{Normal} (0, s_\beta^2) \\ & \qquad \sigma_i \stackrel{\text{ind}}{\sim} \text{Uniform}(0, s_\sigma) \end{aligned} $$

Simple model

Functions:

  • hb_mcmc_mixture_hyperparameters()

The mixture model hyperparameters (mω)i and (sω)i of study i are obtained by analyzing the control group data of study i with the simple model below. (mω)i and (sω)i are taken to be the estimated posterior mean and posterior standard deviation, respectively, of μ from this model.

$$ \begin{aligned} &y \sim \text{Normal}(\mu, \sigma^2) \\ & \qquad \mu \sim \text{Normal}(0, s_\mu^2) \\ & \qquad \sigma \sim \text{Uniform}(0, s_\sigma) \end{aligned} $$

Borrowing metrics

The package supports the following metrics to quantify borrowing.

Effective sample size (ESS)

See the hb_ess() function for an implementation.

Neuenschwander et al. (2006) posit a prior effective sample size metric for meta-analytic predictive (MAP) priors. In the original paper, the underlying hierarchical model only uses historical controls, and the hypothetical new study is the current study of interest. In historicalborrow, we adapt this metric to a hierarchical model which also includes both control and treatment data from the current study. We still define N below to be the number of (non-missing) historical control patients so we can still interpret ESS on the same scale as in the paper.

For the pooled model, define V0 to be the posterior predictive variance of the control mean α* of a hypothetical new unobserved study. According to Neuenschwander et al. (2006), it can be derived as an average of study-specific variances. In practice, we estimate V0 using the average of MCMC samples of $\frac{1}{\sum \sigma_i^{-2}}$.

$$ V_0 := \text{Var}(\alpha^* | y, \tau = 0) = \frac{1}{\sum \sigma_i^{-2}} $$

For the hierarchical model, we define the analogous posterior predictive variance Vτ using the prior distribution.

Vτ := Var(α*|y) = ∫E[(α* − E(α*|y))2|y] ⋅ p(α*|μ, τ) ⋅ p(μ, τ|y)dμdτ

The above integral implies a straightforward method of estimating Vτ using MCMC samples:

  1. For each MCMC sample m = 1, …, M from the hierarchical model, identify samples μ(m) and τ(m) of μ and τ, respectively.
  2. Draw (α*)m from a Normal(μ(m), (τ(m))2) distribution.
  3. Estimate Vτ as the variance of the collection (α*)1, (α*)2, …, (α*)M from (2).

Next, define N as the number of non-missing control patients from the historical studies only. Given N, V0, and Vτ, define the effective sample size as:

$$ \text{ESS} := N \frac{V_0}{V_\tau} $$

$\frac{V_0}{V_\tau}$ is a weight which quantifies the fraction of historical information that the hierarchical model leverages for borrowing. Notably, the weight should be 1 if the hierarchical and pooled model exhibit the same strength of borrowing. Multiplied by N, the quantity becomes a heuristic for the strength of borrowing of the hierarchical model, measured in terms of the number of historical patients.

Precision ratio (hierarchical model only)

The precision ratio is an experimental ad hoc metric and should be used with caution. It is implemented in the hb_summary() function for the hierarchical model.

The precision ratio compares the prior precision of a control mean response (an α component, numerator) to the analogous precision of the full conditional distribution (denominator). The former is $\frac{1}{\tau^2}$, and the latter is $\frac{1}{\tau^2} + \frac{n}{\sigma^2}$. Here, n is the number of non-missing patients in the current study, σ2 is the residual variance, and τ2 is the variance of study-specific control means (components of α). The full precision ratio is:

$$ \begin{aligned} \frac{\frac{1}{\tau^2}}{\frac{1}{\tau^2} + \frac{n}{\sigma^2}} \end{aligned} $$

The precision ratio comes from the conditional distribution of αk in the hierarchical model given the other parameters and the data. More precisely, in this conditional distribution, the mean is a weighted average between the prior mean and data mean, and the precision ratio is the weight on the prior mean. This can be seen in a simpler case with a Bayesian model with a normal data model, a normal prior on the mean, and known constant variance. For details, see Chapter 2 of Gelman et al. (2020).

Variance shift ratio

The variance shift ratio is an experimental ad hoc metric and should be used with caution. It is implemented in the legacy hb_metrics() function.

Let Vm be the estimated posterior variance of αI (current study control group response mean) estimated by model m. The variance shift ratio is:

$$ \begin{aligned} \frac{V_{m*} - V_{\text{independent}}}{V_{\text{pool}} - V_{\text{independent}}} \end{aligned} $$

where m* is a historical borrowing model like the mixture model or hierarchical model.

Mean shift ratio (legacy)

The mean shift ratio is not recommended to measure the strength of borrowing. Rather, it is an informal ad hoc measure of the lack of commensurability between the current and historical data sources. It is implemented in the legacy hb_metrics() function.

To define the mean shift ratio, let θm be the posterior mean control group response estimated by model m. The mean shift ratio is:

$$ \begin{aligned} \frac{\theta_{m*} - \theta_{\text{independent}}}{\theta_{\text{pool}} - \theta_{\text{independent}}} \end{aligned} $$

where m* is a historical borrowing model like the mixture model or hierarchical model.

Posterior mixture proportions (mixture model only)

The posterior mixture proportion of study i is P(π = i), and it is obtained by averaging posterior samples of π.

References

Gelman, A. 2006. “Prior Distributions for Variance Parameters in Hierarchical Models.” Bayesian Analysis 1 (3): 515–43. https://doi.org/10.1214/06-BA117A.
Gelman, A., J. B. Carlin, H. S. Stern, D. B. Dunson, A. Vehtari, and D. B. Rubin. 2020. Bayesian Data Analysis. 3rd ed. CRC Press.
Lenth, Russell V. 2016. “Least-Squares Means: The r Package Lsmeans.” Journal of Statistical Software 69 (1): 1–33. https://doi.org/10.18637/jss.v069.i01.
Neuenschwander, B., G. Capkun-Niggli, M. Branson, and D. J. Spiegelhalter. 2006. “Summarizing Historical Information on Controls in Clinical Trials.” Bayesian Analysis 1 (3): 515–43. https://doi.org/10.1214/06-BA117A.