Title: | Flexible Evaluation of Surrogate Markers with Bayesian Model Averaging |
---|---|
Description: | Provides functions to estimate the proportion of treatment effect explained by the surrogate marker using a Bayesian Model Averaging approach. Duan and Parast (2023) <doi:10.1002/sim.9986>. |
Authors: | Yunshan Duan [aut, cre], Layla Parast [aut] |
Maintainer: | Yunshan Duan <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.0 |
Built: | 2024-11-01 04:24:14 UTC |
Source: | https://github.com/yunshandys/surrogatebma |
Example data
data("exampleData")
data("exampleData")
A data frame with 400 rows and 3 variables:
Y
the primary outcome
S
the surrogate marker
A
the treatmentt arm
data(exampleData) names(exampleData)
data(exampleData) names(exampleData)
Generates a list of hyper-parameters we use by default in the inverse-Gamma-Normal prior for the variance and coefficients, including a0_list, b0_list, mu0_list, Gamma0_list, Gamma0_inv_list , each being a list of 5 with 5 parameters under the 5 different candidate models. An Inv-Gamma(a0, b0) - Normal(mu0, Gamma0) prior is assumed.
gen.prior()
gen.prior()
A list of hyper-parameters, including a0_list, b0_list, mu0_list, Gamma0_list, Gamma0_inv_list , each being a list of 5 with 5 parameters under the 5 different candidate models.
Yunshan Duan
Duan, Y. and Parast, L., 2023. Flexible evaluation of surrogate markers with Bayesian model averaging. Statistics in Medicine.
gen.prior() # if we want to change the prior parameter a0 in model 1 prior.para <- gen.prior() prior.para$a0_list[[1]] <- 1
gen.prior() # if we want to change the prior parameter a0 in model 1 prior.para <- gen.prior() prior.para$a0_list[[1]] <- 1
Gives the posterior probability of each candidate model being true.
post.model(Y, S, A, prior.para = NULL)
post.model(Y, S, A, prior.para = NULL)
Y |
numeric vector; primary outcome, assumed to be continuous. |
S |
numeric vector; surrogate marker, assumed to be continuous. |
A |
numeric vector; treatment arm, assumed to be binary. The treatment arm = 1 when the patient is enrolled in the treatment group, treatment arm = 0 when in the control group. |
prior.para |
a list of hyper-parameters in the inverse-Gamma-Normal prior for the variance and coefficients, including a0_list, b0_list, mu0_list, Gamma0_list, Gamma0_inv_list , each being a list of 5 with 5 parameters under the 5 different candidate models. An Inv-Gamma(a0, b0) - Normal(mu0, |
a numeric vector; the posterior probabilities of the candidate models.
Yunshan Duan
Duan, Y. and Parast, L., 2023. Flexible evaluation of surrogate markers with Bayesian model averaging. Statistics in Medicine.
data(exampleData) post.model(Y = exampleData$Y, S = exampleData$S, A = exampleData$A)
data(exampleData) post.model(Y = exampleData$Y, S = exampleData$S, A = exampleData$A)
Calculates the proportion of treatment effect on the primary outcome explained by the treatment effect on the surrogate marker using Bayesian Model Averaging (BMA). This function is intended to be used for a fully observed continuous outcome and one single continuous surrogate marker. The user can also request to calculate a 95% credible interval, evaluated by Bayesian bootstrapping. A robust option is provided where we choose a more preferrable approach between the BMA and non-parametric methods based on cross-validation.
R.BMA.est(Y, S, A, method = "BMA", nmc = 500, nBB = 100, conf.int = TRUE, alpha = 0.05, prior.para = NULL, kfold.k = 3)
R.BMA.est(Y, S, A, method = "BMA", nmc = 500, nBB = 100, conf.int = TRUE, alpha = 0.05, prior.para = NULL, kfold.k = 3)
Y |
numeric vector; primary outcome, assumed to be continuous. |
S |
numeric vector; surrogate marker, assumed to be continuous. |
A |
numeric vector; treatment arm, assumed to be binary. The treatment arm = 1 when the patient is enrolled in the treatment group, treatment arm = 0 when in the control group. |
method |
"BMA" or "robust"; Default is "BMA". If method = "robust", we choose a more preferrable approach between the BMA and non-parametric methods based on cross-validation. |
nmc |
number of MCMC samples in posterior inference, default is 500. |
nBB |
number of replicates in Bayesian bootstrap, default is 100. Igored if conf.int = FALSE. |
conf.int |
TRUE or FALSE; indicates whether a 95% credible interval for the proportion explained is requested, default is TRUE. |
alpha |
the confidence level for the credible interval, the 100(1 - |
prior.para |
a list of hyper-parameters in the inverse-Gamma-Normal prior for the variance and coefficients, including a0_list, b0_list, mu0_list, Gamma0_list, Gamma0_inv_list , each being a list of 5 with 5 parameters under the 5 different candidate models. An Inv-Gamma(a0, b0) - Normal(mu0, |
kfold.k |
the value of k in k-fold cross validation, default is 3. Ignored if method = "BMA". |
R.est |
the estimate of the proportion explained by the surrogate marker. |
p.model |
the posterior probability of the candidate models being true. |
ci |
the credible (confidence) interval for the proportion explained by the surrogate marker. |
Yunshan Duan
Duan, Y. and Parast, L., 2023. Flexible evaluation of surrogate markers with Bayesian model averaging. Statistics in Medicine.
data(exampleData) R.BMA.est(Y = exampleData$Y, S = exampleData$S, A = exampleData$A)
data(exampleData) R.BMA.est(Y = exampleData$Y, S = exampleData$S, A = exampleData$A)