Skip to contents

This function performs analysis of continuous data using the Meta-Analytic-Predictive (MAP) Prior approach. The method borrows data from non-concurrent controls to obtain the prior distribution for the control response in the concurrent periods.

Usage

MAPprior_cont(
  data,
  arm,
  alpha = 0.025,
  opt = 2,
  prior_prec_tau = 4,
  prior_prec_eta = 0.001,
  n_samples = 1000,
  n_chains = 4,
  n_iter = 4000,
  n_adapt = 1000,
  robustify = TRUE,
  weight = 0.1,
  check = TRUE,
  ...
)

Arguments

data

Data frame with trial data, e.g. result from the datasim_bin() function. Must contain columns named 'treatment', 'response' and 'period'.

arm

Integer. Index of the treatment arm under study to perform inference on (vector of length 1). This arm is compared to the control group.

alpha

Double. Decision boundary (one-sided). Default=0.025

opt

Integer (1 or 2). If opt==1, all former periods are used as one source; if opt==2, periods get separately included into the final analysis. Default=2.

prior_prec_tau

Double. Precision parameter (\(1/\sigma^2_{\tau}\)) of the half normal hyperprior, the prior for the between study heterogeneity. Default=4.

prior_prec_eta

Double. Precision parameter (\(1/\sigma^2_{\eta}\)) of the normal hyperprior, the prior for the hyperparameter mean of the control mean. Default=0.001.

n_samples

Integer. Number of how many random samples will get drawn for the calculation of the posterior mean, the p-value and the CI's. Default=1000.

n_chains

Integer. Number of parallel chains for the rjags model. Default=4.

n_iter

Integer. Number of iterations to monitor of the jags.model. Needed for coda.samples. Default=4000.

n_adapt

Integer. Number of iterations for adaptation, an initial sampling phase during which the samplers adapt their behavior to maximize their efficiency. Needed for jags.model. Default=1000.

robustify

Logical. Indicates whether a robust prior is to be used. If TRUE, a mixture prior is considered combining a MAP prior and a weakly non-informative component prior. Default=TRUE.

weight

Double. Weight given to the non-informative component (0 < weight < 1) for the robustification of the MAP prior according to Schmidli (2014). Default=0.1.

check

Logical. Indicates whether the input parameters should be checked by the function. Default=TRUE, unless the function is called by a simulation function, where the default is FALSE.

...

Further arguments passed by wrapper functions when running simulations.

Value

List containing the following elements regarding the results of comparing arm to control:

  • p-val - posterior probability that the difference in means is less than zero

  • treat_effect - posterior mean of difference in means

  • lower_ci - lower limit of the (1-2*alpha)*100% credible interval for difference in means

  • upper_ci - upper limit of the (1-2*alpha)*100% credible interval for difference in means

  • reject_h0 - indicator of whether the null hypothesis was rejected or not (p_val < alpha)

Details

The MAP approach derives the prior distribution for the control response in the concurrent periods by combining the control information from the non-concurrent periods with a non-informative prior.

The model for the continuous response \(y_{js}\) for the control patient \(j\) in the non-concurrent period \(s\) is defined as follows:

$$E(y_{js}) = \eta_s$$

where \(\eta_s\) represents the control mean in the non-concurrent period \(s\).

The means for the non-concurrent controls in period \(s\) are assumed to have a normal prior distribution with mean \(\mu_{\eta}\) and variance \(\tau^2\):

$$\eta_s \sim \mathcal{N}(\mu_{\eta}, \tau^2)$$

For the hyperparameters \(\mu_{\eta}\) and \(\tau\), normal and half-normal hyperprior distributions are assumed, with mean 0 and variances \(\sigma^2_{\eta}\) and \(\sigma^2_{\tau}\), respectively:

$$\mu_{\eta} \sim \mathcal{N}(0, \sigma^2_{\eta})$$

$$\tau \sim HalfNormal(0, \sigma^2_{\tau})$$

The MAP prior distribution \(p_{MAP}(\eta_{CC})\) for the control response in the concurrent periods is then obtained as the posterior distribution of the parameters \(\eta_s\) from the above specified model.

If robustify=TRUE, the MAP prior is robustified by adding a weakly-informative mixture component \(p_{\mathrm{non-inf}}\), leading to a robustified MAP prior distribution:

$$p_{rMAP}(\eta_{CC}) = (1-w) \cdot p_{MAP}(\eta_{CC}) + w \cdot p_{\mathrm{non-inf}}(\eta_{CC})$$

where \(w\) (parameter weight) may be interpreted as the degree of skepticism towards borrowing strength.

In this function, the argument alpha corresponds to \(1-\gamma\), where \(\gamma\) is the decision boundary. Specifically, the posterior probability of the difference distribution under the null hypothesis is such that: \(P(\mu_{treatment}-\mu_{control}>0) \ge 1-\)alpha. In case of a non-informative prior this coincides with the frequentist type I error.

References

Robust meta-analytic-predictive priors in clinical trials with historical control information. Schmidli, H., et al. Biometrics 70.4 (2014): 1023-1032.

Applying Meta-Analytic-Predictive Priors with the R Bayesian Evidence Synthesis Tools. Weber, S., et al. Journal of Statistical Software 100.19 (2021): 1548-7660.

Author

Katharina Hees

Examples


trial_data <- datasim_cont(num_arms = 3, n_arm = 100, d = c(0, 100, 250),
theta = rep(0.25, 3), lambda = rep(0.15, 4), sigma = 1, trend = "stepwise")

MAPprior_cont(data = trial_data, arm = 3)
#> $p_val
#> [1] 0.1192829
#> 
#> $treat_effect
#> [1] 0.1583661
#> 
#> $lower_ci
#> [1] -0.1193
#> 
#> $upper_ci
#> [1] 0.418047
#> 
#> $reject_h0
#> [1] FALSE
#>