View source: R/glmnetsurvfit.R
concordScore | R Documentation |
The function computes the agreement between the observed response and the predictor.
concordScore(fit, newdata = NULL, stats = FALSE, reverse = TRUE, ...)
fit |
fitted |
newdata |
optional data frame containing the variables appearing on the right hand side of |
stats |
logical. If |
Computes Harrel's C index for predictions for glmnetsurv
, pcoxtime
, coxph
, etc, object and takes into account censoring. See survConcordance
.
an object containing the concordance, followed by the number of pairs that agree, disagree, are tied, and are not comparable.
data(veteran, package="survival") # Penalized lam <- 0.1 alp <- 0.5 pfit1 <- glmnetsurv(Surv(time, status) ~ factor(trt) + karno + diagtime + age + prior , data = veteran , lambda = lam , alpha = alp ) c1 <- concordScore(pfit1) c1 # Unpenalized lam <- 0 alp <- 1 pfit2 <- glmnetsurv(Surv(time, status) ~ factor(trt) + karno + diagtime + age + prior , data = veteran , lambda = lam , alpha = alp ) c2 <- concordScore(pfit2) c2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.