score2proba {survcomp} | R Documentation |
the function uses either a Cox model or the product-limit estimator to compute the survival probabilities from a risk score for a specific point in time.
score2proba(data.tr, score, yr, method = c("cox", "prodlim"), conf.int = 0.95, which.est= c ("point", "lower", "upper"))
data.tr |
the data frame for the training set. This data frame must contain three columns for the times, the event occurrence and the risk score. These columns are called "time", "event" and "score" respectively |
score |
risk score for the test set |
yr |
a point in time for which the survival probabilities must be computed |
method |
method for survival probabilities estimation, either |
conf.int |
value in [0,1]. Default at 0.95 |
which.est |
which estimation to be returned? |
vector of predicted survival probabilities
Benjamin Haibe-Kains
Cox, D. R. (1972) "Regression Models and Life Tables", Journal of the Royal Statistical Society Series B, 34, pages 187–220.
Andersen, P. K. and Borgan, O. and Gill, R. D. and Keiding, N. (1993) "Statistical Models Based on Counting Processes", Springer.
set.seed(12345) age <- rnorm(30, 50, 10) stime <- rexp(30) cens <- runif(30,.5,2) sevent <- as.numeric(stime <= cens) stime <- pmin(stime, cens) dd <- data.frame("time"=stime, "event"=sevent, "score"=age) #Cox's model score2proba(data.tr=dd, score=dd$score, yr=1, method="cox") #product-limit estimator score2proba(data.tr=dd, score=dd$score, yr=1, method="prodlim")