Description Usage Arguments Value Author(s) References See Also Examples
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.
1 2 | 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.
1 2 3 4 5 6 7 8 9 10 11 12 | 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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.