customSuperPc: Univarate shrinkage prediction in the Cox model

Description Usage Arguments Value Author(s) References See Also Examples

Description

See http://cran.r-project.org/web/packages/superpc/index.html for more details

Usually, this function is not called directly but embedded in a call to customSurv from the main package survHD (see examples).

Note that "lambda", if specified, corresponds to the "threshold" argument in superpc.

Usage

1
customSuperPc(Xlearn, Ylearn, learnind,...)

Arguments

Xlearn

Gene expression data (a data.frame)

Ylearn

Survival Response, an object of class Surv.

learnind

An index vector specifying the observations that belong to the learning set. May be missing; in that case, the learning set consists of all observations and predictions are made on the learning set.

...

Further arguments that shall be passed to superpc.train function from the superpc R package (http://cran.r-project.org/web/packages/superpc/index.html)

Value

An object of class ModelLearned.

Author(s)

Levi Waldron lwaldron@hsph.harvard.edu Christoph Bernau bernau@ibe.med.uni-muenchen.de Markus Riester <riester@jimmy.harvard.edu>

References

Bair E, Tibshirani R: Semi-Supervised Methods to Predict Patient Survival from Gene Expression Data. PLoS Biology 2004, 2:e108.

See Also

learnSurvival

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
require(survHD)
require(survival)
require(survHDExtra)	
	set.seed(20)
	nsamples <- 100
	X <- matrix(rnorm(nsamples*1000),nrow=nsamples)
	colnames(X) <- make.names(1:ncol(X))
	rownames(X) <- make.names(1:nrow(X))
	time <- rexp(nsamples)
	cens <- sample(0:1,size=nsamples,replace=TRUE)
	y <- Surv(time,cens)
ModelLearned<-customSurv(X=X,y=y,learnind=1:75,customSurvModel=customSuperPc)	
##linear risk score
predict(ModelLearned@model,newdata=X[-(1:75),],type='lp')
##survival probabilities at each uncensored time
mytimegrid <- sort(c(0.0,y[y[,2]==1,1]))
SurvivalProbs <- predict(ModelLearned,X[-(1:75),],type='SurvivalProbs',timegrid=mytimegrid,gbm=TRUE)@SurvivalProbs
plot(SurvivalProbs,xlab="Time", ylab="Probability of Survival")

bernau/survHDExtra documentation built on May 12, 2019, 4:22 p.m.