risk_newdat: Main function of SurvRank.

Description Usage Arguments Details Value Examples

View source: R/risk_newdat.R

Description

Main input function for SurvRank.

Usage

1
2
risk_newdat(dat_new, sel_names, dat_old, cv.out = 10, c.time = NA,
  detail = NA, plot = F, surv.tab = c(0.5), mcox = T)

Arguments

dat_new

a new data set that is not used for the model building but only for prediction

sel_names

the variables that were selected (from riskscore_fct) (see CVrankSurv_fct)

dat_old

the data set used to fit the survival model

cv.out

number of cross-validation folds for the prediction

c.time

as defined in UnoCsurvAUC time; a positive number restricting the upper limit of the time range under consideration

detail

TRUE do the prediction and Uno's C-Statistic computation for the models using 1:sel_names variables FALSE only save the statistics for the different cross validation folds

plot

TRUE do a plot of the survival curves FALSE no plot

surv.tab

Defaults to c(0.5). Calculates for selected features survival curves. surv.tab determines quantiles of predictions.

mcox

TRUE a cox model is fitted FALSE a Cox model with ridge penalty using cv.out cross-validation folds is fitted

Details

details to follow

Value

Output of the risk_newdat, basically a list containing the following elements

unocv

Matrix of censoring-adjusted C-statistic by Uno et al. for the different cross-validation folds and if detail=T as well for different number of variables

unoi

if detail=T Vector of censoring-adjusted C-statistic by Uno et al. for the different number of variables, if detail=FALSE it correspons to uno_new

rs

model prediction for the new data set

sfit.tab

survfit object according to surv.tab seperation

sfit.diff

surfdiff: Tests if there is a difference between two or more survival curves using the G-rho family of tests, or for a single curve against a known alternative

model

model output for dat_old and using the variables given by sel_names

uno_new

the censoring-adjusted C-statistic by Uno et al. using the prediction for dat_new

Additionally if plot is T, the survival curves given by sfit.tab are plotted

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## Simulating a survival data set
N=100; p=10; n=3
x=data.frame(matrix(rnorm(N*p),nrow=N,p))
beta=rnorm(n)
mx=matrix(rnorm(N*n),N,n)
fx=mx[,seq(n)]%*%beta/3
hx=exp(fx)
ty=rexp(N,hx)
tcens=1-rbinom(n=N,prob=.3,size=1)
y=Surv(ty,tcens)
data=list()
data$x<-x; data$y<-y
## CV object
out<-CVrankSurv_fct(data,2,3,3,fs.method="cox.rank")
## The variables selected from the \code{\link{riskscore_fct}}
selected<-riskscore_fct(out,data,list.t="weighted")$selnames
## Applying the risk_newdat function
x=data.frame(matrix(rnorm(N*p),nrow=N,p))
beta=rnorm(n)
mx=matrix(rnorm(N*n),N,n)
fx=mx[,seq(n)]%*%beta/3
hx=exp(fx)
ty=rexp(N,hx)
tcens=1-rbinom(n=N,prob=.3,size=1)
y=Surv(ty,tcens)
data_new=list()
data_new$x<-x; data_new$y<-y
risk<-risk_newdat(data_new,selected,data)

SurvRank documentation built on May 30, 2017, 2:53 a.m.