| concordScore.pcoxtime | R Documentation |
The function computes the agreement between the observed response and the predictor.
## S3 method for class 'pcoxtime' 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 |
reverse |
if TRUE (default) then assume that larger x values predict smaller response values y; a proportional hazards model is the common example of this. |
... |
additional arguments passed to |
Computes Harrell's C index for predictions for pcoxtime object and takes into account censoring. See concordance.
an object containing the concordance, followed by the number of pairs that agree, disagree, are tied, and are not comparable.
if (packageVersion("survival")>="3.2.9") {
data(cancer, package="survival")
} else {
data(veteran, package="survival")
}
# Penalized
lam <- 0.1
alp <- 0.5
pfit1 <- pcoxtime(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 <- pcoxtime(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.