VS {BayesSurvive} | R Documentation |
Function to perform variable selection
Description
Perform variable selection using the 95 neighborhood criterion (SNC), median probability model (MPM) or Bayesian false discovery rate (FDR). Note that the Bayesian FDR only applies for each subgroup if there are subgroups.
Usage
VS(x, method = "FDR", threshold = NA, subgroup = 1)
Arguments
x |
fitted object obtained with |
method |
variable selection method to choose from
|
threshold |
SNC threshold value (default 0.5) or the Bayesian expected false discovery rate threshold (default 0.05) |
subgroup |
index of the subgroup for visualizing posterior coefficients |
Value
A boolean vector of selected (= TRUE) and rejected (= FALSE) variables
References
Lee KH, Chakraborty S, Sun J (2015). Survival prediction and variable selection with simultaneous shrinkage and grouping priors. Statistical Analysis and Data Mining, 8:114-127
Newton MA, Noueiry A, Sarkar D, Ahlquist P (2004). Detecting differential gene expression with a semiparametric hierarchical mixture method. Biostatistics, 5(2), 155-76
Examples
library("BayesSurvive")
set.seed(123)
# Load the example dataset
data("simData", package = "BayesSurvive")
dataset <- list(
"X" = simData[[1]]$X,
"t" = simData[[1]]$time,
"di" = simData[[1]]$status
)
# Initial value: null model without covariates
initial <- list("gamma.ini" = rep(0, ncol(dataset$X)))
# Hyperparameters
hyperparPooled <- list(
"c0" = 2, # prior of baseline hazard
"tau" = 0.0375, # sd for coefficient prior
"cb" = 20, # sd for coefficient prior
"pi.ga" = 0.02, # prior variable selection probability for standard Cox models
"a" = -4, # hyperparameter in MRF prior
"b" = 0.1, # hyperparameter in MRF prior
"G" = simData$G # hyperparameter in MRF prior
)
# run Bayesian Cox with graph-structured priors
fit <- BayesSurvive(
survObj = dataset, hyperpar = hyperparPooled,
initial = initial, nIter = 100
)
# show variable selection
VS(fit, method = "FDR")