Learn R Programming

pcoxtime (version 1.0.4)

concordScore.pcoxtime: 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 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.

Value

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

Details

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

Examples

Run this code
# NOT RUN {
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

# }

Run the code above in your browser using DataLab