| predict.RLassoCox {RLassoCox} | R Documentation |
This function predicts the risk of new samples from a fitted RLasso-Cox
model.
## S3 method for class 'RLassoCox' predict(object, newx, ...)
object |
Fitted |
newx |
A matrix with new samples to predict. |
... |
Arguments to be passed to |
Predicted results of new patients in newx.
Wei Liu
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 ,]
res <- RLassoCox(x=trainSmpl, y=survData[trainSmpl.Idx ,],
globalGraph=dGMMirGraph)
lp <- predict(object = res, newx = testSmpl)