View source: R/MAPprior_cont.R
MAPprior_cont | R Documentation |
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.
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, ... )
data |
Data frame with trial data, e.g. result from the |
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/σ^2_{τ}) of the half normal hyperprior, the prior for the between study heterogeneity. Default=4. |
prior_prec_eta |
Double. Precision parameter (1/σ^2_{η}) 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. |
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}) = η_s
where η_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 μ_{η} and variance τ^2:
η_s \sim \mathcal{N}(μ_{η}, τ^2)
For the hyperparameters μ_{η} and τ, normal and half-normal hyperprior distributions are assumed, with mean 0 and variances σ^2_{η} and σ^2_{τ}, respectively:
μ_{η} \sim \mathcal{N}(0, σ^2_{η})
τ \sim HalfNormal(0, σ^2_{τ})
The MAP prior distribution p_{MAP}(η_{CC}) for the control response in the concurrent periods is then obtained as the posterior distribution of the parameters η_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}(η_{CC}) = (1-w) \cdot p_{MAP}(η_{CC}) + w \cdot p_{\mathrm{non-inf}}(η_{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-γ, where γ is the decision boundary. Specifically, the posterior probability of the difference distribution under the null hypothesis is such that:
P(μ_{treatment}-μ_{control}>0) ≥ 1-alpha
.
In case of a non-informative prior this coincides with the frequentist type I error.
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
)
Katharina Hees
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.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.