library(historicalborrow)
This vignette defines the models and historical borrowing metrics supported in the historicalborrow
package.
Each primary model is parameterized thus:
E(y)=Xαα+Xδδ+Xββ
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,
E(yijk)=I(j=1)αk+I(j>1)δjk+(Xββ)ijk
This parameterization is represented in the more compact expression Xαα+Xδδ+Xββ in the model definitions in this vignette.
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 X∗i=[Xα∗Xδ∗Xβ∗]i is full rank. (Here, X∗i 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.
The hb_summary()
function post-processes the results from the model. It accepts MCMC samples of parameters and returns interpretable group-level posterior summaries such as change from baseline response and treatment effect. To arrive at these summaries, hb_summary()
computes marginal posteriors of transformed parameters. The transformations derive patient-level fitted values from model parameters, then derive group-level responses as averages of fitted values. We refer to this style of estimation as “unconditional estimation”, as opposed to “conditional estimation”, which takes each group mean to be the appropriate linear combination of the relevant α and δ parameters, without using β components or going through fitted values. If the baseline covariates are balanced across studies, unconditional and conditional estimation should produce similar estimates of control and treatment effects. This approach to post-processing is explained in section III.C of the FDA draft guidance on adjusting for covariates.
Functions:
hb_sim_mixture()
hb_mcmc_mixture()
The mixture model analyzes only the data from the current study, so we use Xmixtureα instead of Xα. Xmixtureα 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.
yijind∼N((Xmixtureαα+Xδδ+Xββ)ij, σ2)α=ωπωiind∼Normal((mω)i,(sω)2i)π∼Categorical(pω)δdind∼Normal(0,s2δ)βb∼Normal(0,s2β)σ∼Uniform(0,sσ)
Functions:
hb_sim_hierarchical()
hb_mcmc_hierarchical()
hb_s_tau()
The hierarchical model analyzes the data from all studies and shrinks the control group means αi towards a common normal distribution with mean μ and variance τ2.
yij∼N((Xαα+Xδδ+Xββ)ij, σ2i)αiind∼Normal(μ,τ2)μ∼Normal(0,s2μ)τ∼Uniform(0,sτ)δdind∼Normal(0,s2δ)βbind∼Normal(0,s2β)σiind∼Uniform(0,sσ)
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.
yij∼N((Xαα+Xδδ+Xββ)ij, σ2i)αiind∼Normal(0,s2α)δdind∼Normal(0,s2δ)βbind∼Normal(0,s2β)σiind∼Uniform(0,sσ)
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 Xpoolα, 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.
yij∼N((Xpoolαα+Xδδ+Xββ)ij, σ2i)α∼Normal(0,s2α)δdind∼Normal(0,s2δ)βbind∼Normal(0,s2β)σiind∼Uniform(0,sσ)
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.
y∼Normal(μ,σ2)μ∼Normal(0,s2μ)σ∼Uniform(0,sσ)
Let θm be the posterior mean control group response estimated by model m. The mean shift ratio is:
θm∗−θindependentθpool−θindependent
where m∗ is a historical borrowing model like the mixture model or hierarchical model.
Let Vm be the estimated posterior variance of αI (current study control group response mean) estimated by model m. The variance shift ratio is:
Vm∗−VindependentVpool−Vindependent
where m∗ is a historical borrowing model like the mixture model or 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 1τ2, and the latter is 1τ2+nσ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:
1τ21τ2+nσ2
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 Bayesian Data Analysis 3rd Ed. by Gelman et al.
It is almost always best to set a diffuse prior on τ so that hierarchical borrowing is fully dynamic. However, in extreme cases (e.g. few historical studies, combined with other issues), there may not be enough information to precisely estimate a variance among placebo means in the hierarchical model, the function hb_s_tau()
suggests a value of sτ that assigns a desired prior precision ratio. if P is the desired prior precision ratio, then:
P=1τ21τ2+nσ2
Solving for τ:
τ=σ√1n(1P−1)
If we expect the mean of τ to be as above, then our uniform upper bound is double:
sτ=2σ√1n(1P−1)
The posterior mixture proportion of study i is P(π=i), and it is obtained by averaging posterior samples of π.