score2proba: Function to compute the survival probabilities from a risk...

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

Description

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.

Usage

1
2
score2proba(data.tr, score, yr, method = c("cox", "prodlim"),
  conf.int = 0.95, which.est= c ("point", "lower", "upper"))

Arguments

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 cox or prodlim for the Cox model or the product-limit estimator, respectively

conf.int

value in [0,1]. Default at 0.95

which.est

which estimation to be returned? point for the point estimate, lower for the lower bound and upper for the upper bound

Value

vector of predicted survival probabilities

Author(s)

Benjamin Haibe-Kains

References

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.

See Also

coxph, prodlim

Examples

 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")

bhklab/survcomp documentation built on Dec. 26, 2021, 6:41 a.m.