R.BMAonly: Calculates the proportion of treatment effect explained

View source: R/SurrogateBMA_functions.R

R.BMAonlyR Documentation

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. 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. The MSE of predicting the primary outcome in the treatment can be calculated when test data is given.

Usage

R.BMAonly(Y, S, A, nmc = 500, nBB = 100, conf.int = TRUE, alpha = 0.05, 
prior.para = NULL, testdata = FALSE, Ytest = NULL, Stest = NULL, Atest = 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.

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

testdata

TRUE or FALSE; indicates whether test data is available, default is FALSE. The MSE of predicting the primary outcome is evaluated if TRUE.

Ytest

numeric vector; primary outcome in test data, assumed to be continuous. Default is NULL, ignored if testdata = FALSE.

Stest

numeric vector; surrogate marker in test data, assumed to be continuous. Default is NULL, ignored if testdata = FALSE.

Atest

numeric vector; treatment arm in test data, 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. Default is NULL, ignored if testdata = FALSE.

Value

R.BMA

the estimate of the proportion explained by the surrogate marker.

p.model

the posterior probability of the candidate models being true.

ci

the credible interval for the proportion explained by the surrogate marker.

MSE

the MSE of predicting the primary outcome for test data.

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.BMAonly(Y = exampleData$Y, S = exampleData$S, A = exampleData$A)


SurrogateBMA documentation built on May 29, 2024, 8:55 a.m.