Package 'SurrogateBMA'

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

Help Index


Example data

Description

Example data

Usage

data("exampleData")

Format

A data frame with 400 rows and 3 variables:

Y

the primary outcome

S

the surrogate marker

A

the treatmentt arm

Examples

data(exampleData)
names(exampleData)

Generates the default prior hyperparameters

Description

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, σ2\sigma^2 Gamma0) prior is assumed.

Usage

gen.prior()

Value

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.

Author(s)

Yunshan Duan

References

Duan, Y. and Parast, L., 2023. Flexible evaluation of surrogate markers with Bayesian model averaging. Statistics in Medicine.

Examples

gen.prior()

# if we want to change the prior parameter a0 in model 1
prior.para <- gen.prior()
prior.para$a0_list[[1]] <- 1

Calculates the posterior probability of the candidate models

Description

Gives the posterior probability of each candidate model being true.

Usage

post.model(Y, S, A, prior.para = NULL)

Arguments

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, σ2\sigma^2 Gamma0) prior is assumed.

Value

a numeric vector; the posterior probabilities of the candidate models.

Author(s)

Yunshan Duan

References

Duan, Y. and Parast, L., 2023. Flexible evaluation of surrogate markers with Bayesian model averaging. Statistics in Medicine.

Examples

data(exampleData)
post.model(Y = exampleData$Y, S = exampleData$S, A = exampleData$A)

Calculates the proportion of treatment effect explained

Description

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.

Usage

R.BMA.est(Y, S, A, method = "BMA", nmc = 500, nBB = 100, conf.int = TRUE, 
alpha = 0.05, prior.para = NULL, kfold.k = 3)

Arguments

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 - α\alpha)% credible interval is calculated. Default is 0.05, ignored if conf.int = FALSE.

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, σ2\sigma^2 Gamma0) prior is assumed.

kfold.k

the value of k in k-fold cross validation, default is 3. Ignored if method = "BMA".

Value

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.

Author(s)

Yunshan Duan

References

Duan, Y. and Parast, L., 2023. Flexible evaluation of surrogate markers with Bayesian model averaging. Statistics in Medicine.

Examples

data(exampleData)
R.BMA.est(Y = exampleData$Y, S = exampleData$S, A = exampleData$A)