Learn R Programming

BMA (version 3.12)

bic.surv: Bayesian Model Averaging for Survival models.

Description

Bayesian Model Averaging for Cox proportional hazards models for censored survival data. This accounts for the model uncertainty inherent in the variable selection problem by averaging over the best models in the model class according to approximate posterior model probability

Usage

bic.surv(x, surv.t, cens, strict = FALSE, OR = 20, maxCol = 30, 
     prior.param = c(rep(0.5, ncol(x))), OR.fix = 2, nbest = 150, 
     factor.type = TRUE, factor.prior.adjust = FALSE, call = NULL, ...)

bic.surv(f, data, strict = FALSE, OR = 20, maxCol = 30, 
     prior.param = c(rep(0.5, ncol(x))), OR.fix = 2, nbest = 150, 
     factor.type = TRUE, factor.prior.adjust = FALSE, call = NULL, ...)

Arguments

Value

  • bic.surv returns an object of class bic.surv The function summary is used to print a summary of the results. The function plot is used to plot posterior distributions for the coefficients. The function imageplot generates an image of the models which were averaged over. An object of class bic.glm is a list containing at least the following components:
  • postprobthe posterior probabilities of the models selected
  • labellabels identifying the models selected
  • bicvalues of BIC for the models
  • sizethe number of independent variables in each of the models
  • whicha logical matrix with one row per model and one column per variable indicating whether that variable is in the model
  • probne0the posterior probability that each variable is non-zero (in percent)
  • postmeanthe posterior mean of each coefficient (from model averaging)
  • postsdthe posterior standard deviation of each coefficient (from model averaging)
  • condpostmeanthe posterior mean of each coefficient conditional on the variable being included in the model
  • condpostsdthe posterior standard deviation of each coefficient conditional on the variable being included in the model
  • mlematrix with one row per model and one column per variable giving the maximum likelihood estimate of each coefficient for each model
  • sematrix with one row per model and one column per variable giving the standard error of each coefficient for each model
  • reduceda logical indicating whether any variables were dropped before model averaging
  • droppeda vector containing the names of those variables dropped before model averaging
  • callthe matched call that created the bma.lm object

synopsis

bic.surv(x, ...)

Details

Bayesian Model Averaging accounts for the model uncertainty inherent in the variable selection problem by averaging over the best models in the model class according to approximate posterior model probability. bic.surv averages of Cox regression models.

References

Volinsky, C.T., Madigan, D., Raftery, A.E. and Kronmal, R.A. (1997). "Bayesian Model Averaging in Proportional Hazard Models: Assessing the Risk of a Stroke." Applied Statistics 46: 433-448

See Also

summary.bic.surv, print.bic.surv, plot.bic.surv

Examples

Run this code
## veteran data
library(survival)
data(veteran)

test.bic.surv<- bic.surv(Surv(time,status) ~ ., data = veteran, factor.type = TRUE)
summary(test.bic.surv, conditional=FALSE, digits=2)
plot(test.bic.surv)

imageplot.bma(test.bic.surv)



## pbc data
data(pbc)
x<- pbc[1:312,]
surv.t<- x$time
cens<- as.numeric((x$status == 2))


x<- x[,c("age", "albumin", "alk.phos", "ascites", "bili", "edema", "hepato", "platelet", "protime", "sex", "ast", "spiders", "stage", "trt", "copper")]



x$bili<- log(x$bili)
x$alb<- log(x$alb)
x$protime<- log(x$protime)
x$copper<- log(x$copper)
x$ast<- log(x$ast)


test.bic.surv<- bic.surv(x, surv.t, cens, factor.type=FALSE, strict=FALSE)
summary(test.bic.surv)

Run the code above in your browser using DataLab