predict.cvRLassoCox {RLassoCox}R Documentation

Make predictions from a cross-validated RLasso-Cox model

Description

This function makes predictions from a cross-validated RLasso-Cox model, using the optimal value chosen for lambda.

Usage

## S3 method for class 'cvRLassoCox'
predict(object, newx, ...)

Arguments

object

cross-validated RLasso-Cox model

newx

A matrix with new samples to predict.

...

Arguments to be passed to predict.cv.glmnet in R package glmnet.

Value

Predicted results of new patients in newx.

Examples

library("survival")
library("igraph")
library("glmnet")
library("Matrix")

data(dGMMirGraph)
data(mRNA_matrix)
data(survData)

trainSmpl.Idx <- sample(1:dim(mRNA_matrix)[1], floor(2/3*dim(mRNA_matrix)[1]))
testSmpl.Idx <- setdiff(1:dim(mRNA_matrix)[1], trainSmpl.Idx)
trainSmpl <- mRNA_matrix[trainSmpl.Idx ,]
testSmpl <- mRNA_matrix[testSmpl.Idx ,]

cv.res <- cvRLassoCox(x=trainSmpl, y=survData[trainSmpl.Idx ,], 
                        globalGraph=dGMMirGraph, nfolds = 5)
lp <- predict(object = cv.res, newx = testSmpl, 
                            s = "lambda.min")

[Package RLassoCox version 1.0.0 Index]