Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculation of the concordance index #2

Open
annette987 opened this issue Nov 30, 2018 · 1 comment
Open

Calculation of the concordance index #2

annette987 opened this issue Nov 30, 2018 · 1 comment

Comments

@annette987
Copy link

I followed the example from your paper (see below) and then tried to compute the concordance index using your function conindex. But I get a much lower value than you achieved. Similarly when I run the same test on my own data I get a very low concordance index using conindex.

  1. How did you calculate the c-index values reported in your paper?
  2. Am I doing something wrong?
data(veteran, package = "survival")
set.seed(123)
n <- nrow(veteran)
train.index <- sample(1:n, 0.7 * n, replace = FALSE)
test.index <- setdiff(1:n, train.index)

survsvm.reg <- survivalsvm(Surv(diagtime, status) ~ .,
                           subset = train.index, data = veteran,
                           type = "regression", gamma.mu = 1,
                           opt.meth = "quadprog", kernel = "add_kernel")

print(survsvm.reg)

pred.survsvm.reg <- predict(object = survsvm.reg,
                            newdata = veteran, subset = test.index)

print(pred.survsvm.reg)
conindex(pred.survsvm.reg, veteran$time[test.index])
survivalsvm result

Call:

 survivalsvm(Surv(diagtime, status) ~ ., subset = train.index, data = veteran, type = "regression", gamma.mu = 1, opt.meth = "quadprog", kernel = "add_kernel") 

Survival svm approach              : regression 
Type of Kernel                     : add_kernel 
Optimization solver used           : quadprog 
Number of support vectors retained : 39 
survivalsvm version                : 0.0.5 


survivalsvm prediction

Type of survivalsvm                      : regression 
Type of kernel                           : add_kernel 
Optimization solver used in model        : quadprog 
predicted risk ranks                     : 13.89 14.95 11.12 15.6 10.7 ...
survivalsvm version                      : 0.0.5 
  C Index 
0.5005848 
@mnwright
Copy link
Member

mnwright commented Nov 30, 2018

Ouch, I think we have a typo in that example. The time variable in the veteran data is called time and not diagtime. It should read

survsvm.reg <- survivalsvm(Surv(time, status) ~ .,
                           subset = train.index, data = veteran,
                           type = "regression", gamma.mu = 1,
                           opt.meth = "quadprog", kernel = "add_kernel")

@fouodo Don't we need the censoring status to calculate the C-index? I'll open a pull request for that. See #3.

@annette987 In the meantime, you could use

Hmisc::rcorr.cens(pred.survsvm.reg$predicted, Surv(veteran$time[test.index], veteran$status[test.index]))

to calculate the C-index.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants