The package varmap provides functions for incorporating prior information into the nuisance parameter based sample size re-estimation in two-arm parallel group superiority trials as it has been discussed in detail by Mütze et al. (2018). This document provides a worked-out example for nuisance parameter based sample size re-estimation in the case of a normally distributed endpoint.


Introduction

In the following we introduce the statistical model as well as the general idea for incorporating prior information into the nuisance parameter based sample size re-estimation procedure in clinical trials with internal pilot study. We consider a two-arm parallel group superiority trial with a normally distributed endpoint. More precisely, let $X_{ij}$, $j=1,\ldots,n_i$, $i=T,C$, be independently normally distributed with group mean $\mu_i$ and variance $\sigma^2$, i.e. \begin{align} X_{ij}|\mu_{i}, \sigma^2 \sim \mathcal{N}\left(\mu_i, \sigma^2 \right). \end{align} Moreover, it is assumed that the clinical trial is planned and analyzed using frequentist methods. The hypothesis of interest is the superiority of the (T)reatment over (C)ontrol which can be written as
\begin{align} H_{0}: \mu_T \leq \mu_C \qquad \text{vs.} \qquad H_{1}: \mu_T > \mu_C. \end{align} The most common frequentist approach to test the null hypothesis $H_0$ is a one-sided two-sample Student's t-test. The total sample size $n$ of the respective clinical trial which aims to assess the null hypothesis $H_0$ which a power of $1-\beta$ can be approximated by \begin{align} n=4\frac{(q_{\alpha} + q_{\beta})^2}{\delta^2\sigma^2} \end{align} under the assumption of equal sample sizes within the groups. Here, $\delta$ is the assumed treatment effect under the alternative and $q_p$ is the $p\%$-quantile of a standard normal distribution. In nuisance parameter based sample size re-estimation in clinical trials with internal pilot study, the preplanned sample size of the clinical trial is adjusted mid-course using an estimated of variance $\sigma^2$ obtained with the results from the internal pilot study. To incorporate prior data about the variance into the sample size re-estimation, the prior information is updated after the internal pilot study. Then, a Bayes estimator for the variance $\sigma^2$ is calculated from the posterior distribution. The Bayes estimator is then plugged into the sample size formula. When updating the prior information about the variance the $n_1$ observations from the internal pilot study are unblinded and assumed to be normally distributed as introduced above. Let $p(\mu_T, \mu_C, \omega)$ be the prior density of the means $\mu_T, \mu_C$ and the precision $\omega$. Additionally, the group means from the internal pilot study are given by $\bar{X}{1T}$ and $\bar{X}{1C}$ and the pooled variance estimator is denoted by $\hat{\sigma}^2_{1,pool}$. For the posterior hold \begin{align} p\left(\mu_T, \mu_C, \omega|\bar{X}{1T}, \bar{X}{1C}, \hat{\sigma}^2_{1,pool}\right) \propto p\left(\bar{X}{1T}, \bar{X}{1C}, \hat{\sigma}^2_{1,pool}|\mu_T, \mu_C, \omega\right) p(\mu_T, \mu_C, \omega). \end{align} Furthermore, the prior of the means is an improper uniform prior. The prior of the means is a-prior independent of the prior for the precision which is a mixture of Gamma distributions. Thus it hold \begin{align} p(\mu_T, \mu_C) = p(\mu_T) p(\mu_C) = 1,\ p(\mu_T, \mu_C, \omega) = p(\mu_T, \mu_C) p(\omega). \end{align} Since the mixture of Gamma distributions is a conjugate prior for the precision, the posterior follows a mixture of Gamma distributions, too. To re-estimate the sample size under consideration of prior information, a Bayes estimator such as the posterior mean or the posterior median are plugged in to the sample size formula. For more details, see Mütze et al. (2018).

Example

In this example it is illustrated how prior information can be integrated into the sample size re-estimation. We assume that an MAP prior for the variance has been determined through a meta-analysis of the dataset varianceSPB as presented in the other vignette of this package. The MAP prior of the variance is mixture of two inverse Gamma distributions, i.e. \begin{align} 0.27 \operatorname{InvGamma}(10.1, 2272.2) + 0.73 \operatorname{InvGamma}(34.48, 8419.3). \end{align} When prior information on the variance should be incorporated into the sample size re-estimation, the prior must be updated with the data from the internal pilot study. Thereto, it is sufficient to know the pooled sample variance $\hat{\sigma}{1,pool}^{2}$. To update the prior distribution for the variance, the R package varmap contains the function update_var_prior. It's arguments are the parameters of the prior distribution, the sample variance and the degrees of freedom. Here, we assume a sample variance of $\hat{\sigma}{1,pool}^{2}=200$ from an internal pilot study of $n_1=120$ which corresponds to $df=118$ degrees of freedom. The next chunk shows the R code for updating the prior information.

library(varmap)
prior <- list(w = c(0.27, 0.73), shape = c(10.1, 34.48), rate = c(2272.2, 8419.3))
posterior <- update_var_prior(prior = prior, sample_var = 200, degf = 118)
posterior

The function update_var_prior returns the parameters of the posterior distribution. To re-estimate the sample size under consideration of the prior information, a Bayes estimator from the posterior distribution is determined and plugged into the sample size formula. Examples for the Bayes estimator are the posterior mean or the posterior median. The posterior mean is the mean of a mixture of inverse Gamma distribution, that is \begin{align} \sum_{l=1}^{L}w_l \frac{b_l}{a_l-1} \end{align} with $w_l$ the weight of the $l$-th mixture component and $a_l$ and $b_l$ the shape parameter and the rate parameter, respectively. For the median of a mixture of inverse Gamma distribution, no closed form expression exist, but the numeric calculations can be performed with the function qmixinvgamma. The next snipped shows the calculation of the posterior mean and median.

post_mean <- posterior$w %*% (posterior$rate / (posterior$shape - 1))
post_median <- qmixinvgamma(p = 0.5, w = posterior$w, shape = posterior$shape,
                            rate = posterior$rate)

Using the Bayes estimator, the sample size can now be re-estimated under consideration of prior information by plugging the Bayes estimator into the sample size formula above.

References



tobiasmuetze/varmap documentation built on Dec. 8, 2022, 2:16 p.m.