[R] sbrier in ipred

Haesook Kim kim at jimmy.harvard.edu
Tue Oct 26 21:24:32 CEST 2010


Hello

I am trying to use sbrier in ipred but got an error message (see below).
Can someone help?
-----------
I. function()
{
library(ipred)
library(survival)
set.seed(12345)
age <- rnorm(30, 50, 10)
stime <- rexp(30)
cens <- runif(30,.5,2)
sevent <- as.numeric(stime <= cens)
stime <- pmin(stime, cens)
mod <- survfit(coxph(Surv(stime, sevent) ~ age))
sb <- sbrier(Surv(stime, sevent), mod)
print(sb)
}
 > brier_demo()
Error in switch(ptype, survfit = { :
switch: EXPR must return a length 1 vector

II
Error in switch(ptype, survfit = { :
cannot compute integrated Brier score with pred

--------
Thank you
Haesook



More information about the R-help mailing list