concordScore.pcoxtime: Compute the concordance statistic for the pcoxtime model

View source: R/posthocfuns.R

concordScore.pcoxtimeR Documentation

Compute the concordance statistic for the pcoxtime model

Description

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

Usage

## S3 method for class 'pcoxtime'
concordScore(fit, newdata = NULL, stats = FALSE, reverse = TRUE, ...)

Arguments

fit

fitted pcoxtime.

newdata

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

stats

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

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 concordance.

Details

Computes Harrell's C index for predictions for pcoxtime object and takes into account censoring. See concordance.

Value

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

Examples


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


pcoxtime documentation built on May 13, 2022, 1:05 a.m.