Last data update: 2014.03.03

R: Predicted patient risk scores from iterative Bayesian Model...
predictBicSurvR Documentation

Predicted patient risk scores from iterative Bayesian Model Averaging

Description

This function predicts the risk scores for patient samples in the test set.

Usage

predictBicSurv(newdata.vec, postprob.vec, mle.mat)

Arguments

newdata.vec

A vector consisting of the data from a test sample.

postprob.vec

A vector consisting of the posterior probability of each BMA selected model.

mle.mat

A matrix with one row per model and one column per variable giving the maximum likelihood estimate of each coefficient for each bic.surv selected model.

Details

The function begins by computing the risk score of each model k in the selected set of models M. The risk score for a model k = sum (coefficient in model k * corresponding expression level in newdata.vec). The function then predicts a patient risk score by summing the product of the posterior probability of model k and the risk score of model k over all models in M. In other words, predicted patient risk score = sum (postprob model k * risk score model k). This function is called by iterateBMAsurv.train.predict.assess.

Value

A real number representing the predicted risk score of a given patient sample.

References

Annest, A., Yeung, K.Y., Bumgarner, R.E., and Raftery, A.E. (2008). Iterative Bayesian Model Averaging for Survival Analysis. Manuscript in Progress.

Raftery, A.E. (1995). Bayesian model selection in social research (with Discussion). Sociological Methodology 1995 (Peter V. Marsden, ed.), pp. 111-196, Cambridge, Mass.: Blackwells.

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

Yeung, K.Y., Bumgarner, R.E. and Raftery, A.E. (2005) Bayesian Model Averaging: Development of an improved multi-class, gene selection and classification tool for microarray data. Bioinformatics 21: 2394-2402.

See Also

iterateBMAsurv.train.predict.assess, iterateBMAsurv.train.wrapper, predictiveAssessCategory, trainData, trainSurv, trainCens, testData

Examples

library (BMA)
library (iterativeBMAsurv)
data(trainData)
data(trainSurv)
data(trainCens)
data(testData)

## Training phase: select relevant genes. Assume the training data is sorted 
## and includes the desired number of top-ranked genes.
ret.list <- iterateBMAsurv.train.wrapper (x=trainData, surv.time=trainSurv, cens.vec=trainCens, nbest=5)
ret.bma <- ret.list$obj

## Get the selected genes with probne0 > 0
selected.genes <- ret.list$curr.names[ret.bma$probne0 > 0]

## Get the subset of test data with the genes from the last iteration of bic.surv
curr.test.dat <- testData [, selected.genes]

## Compute the predicted risk scores for the test samples
y.pred.test <- apply (curr.test.dat, 1, predictBicSurv, postprob.vec=ret.bma$postprob, mle.mat=ret.bma$mle)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(iterativeBMAsurv)
Loading required package: BMA
Loading required package: survival
Loading required package: leaps
Loading required package: robustbase

Attaching package: 'robustbase'

The following object is masked from 'package:survival':

    heart

Loading required package: inline
Loading required package: rrcov
Scalable Robust Estimators with High Breakdown Point (version 1.3-11)

Loading required package: splines
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/iterativeBMAsurv/predictBicSurv.Rd_%03d_medium.png", width=480, height=480)
> ### Name: predictBicSurv
> ### Title: Predicted patient risk scores from iterative Bayesian Model
> ###   Averaging
> ### Aliases: predictBicSurv
> ### Keywords: survival
> 
> ### ** Examples
> 
> library (BMA)
> library (iterativeBMAsurv)
> data(trainData)
> data(trainSurv)
> data(trainCens)
> data(testData)
> 
> ## Training phase: select relevant genes. Assume the training data is sorted 
> ## and includes the desired number of top-ranked genes.
> ret.list <- iterateBMAsurv.train.wrapper (x=trainData, surv.time=trainSurv, cens.vec=trainCens, nbest=5)
17: Explored up to variable # 100
Iterate bic.surv is done!
Selected genes:
 [1] "X31687" "X33840" "X31242" "X16948" "X31471" "X17154" "X28531" "X19241"
 [9] "X26146" "X17804" "X27332" "X17241" "X32212" "X29911" "X33558" "X33013"
[17] "X27884" "X33706" "X16817" "X31968" "X30209" "X29650" "X25054" "X16988"
[25] "X32904"
Posterior probabilities of selected genes:
 [1] 100.0  47.5  47.3   2.4  38.5  28.5  40.1  96.7   2.8   1.7   0.0  59.9
[13]   0.0   0.0  10.0   0.0   2.5  58.3   2.1  98.8  28.4   7.1  95.1   0.0
[25] 100.0
> ret.bma <- ret.list$obj
> 
> ## Get the selected genes with probne0 > 0
> selected.genes <- ret.list$curr.names[ret.bma$probne0 > 0]
> 
> ## Get the subset of test data with the genes from the last iteration of bic.surv
> curr.test.dat <- testData [, selected.genes]
> 
> ## Compute the predicted risk scores for the test samples
> y.pred.test <- apply (curr.test.dat, 1, predictBicSurv, postprob.vec=ret.bma$postprob, mle.mat=ret.bma$mle)
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>