concordScore: Compute the concordance statistic for the pcoxtime model

View source: R/glmnetsurvfit.R

concordScoreR Documentation

Compute the concordance statistic for the pcoxtime model

Description

The function computes the agreement between the observed response and the predictor.

Usage

concordScore(fit, newdata = NULL, stats = FALSE, reverse = TRUE, ...)

Arguments

fit

fitted glmnetsurv, pcoxtime, coxph, etc.

newdata

optional data frame containing the variables appearing on the right hand side of glmnetsurv formula.

stats

logical. If TRUE all the related concordance statistics are returned.

Details

Computes Harrel's C index for predictions for glmnetsurv, pcoxtime, coxph, etc, object and takes into account censoring. See survConcordance.

Value

an object containing the concordance, followed by the number of pairs that agree, disagree, are tied, and are not comparable.

Examples


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


CYGUBICKO/glmnetpostsurv documentation built on Sept. 1, 2022, 7:26 p.m.