Closed mayrandy closed 8 years ago
Following code (similar to the one we use to generate survival data for mboost checks) breaks:
x1 <- rnorm(100) x2 <- x1 + rnorm(100) X <- cbind(x1, x2) beta <- c(1, 0.5) survtime <- exp(X%*%beta) event <- rep(c(TRUE, FALSE), 50) IPCweights(Surv(survtime, event)) Error in [.default`(x, , "time") : subscript out of bounds
The reason seems to be, that the object Surv(survtime, event) does not include the appropriate names:
Surv(survtime, event)
x <- Surv(survtime, event) dimnames(x)[[2]] [1] "" "status"
and therefore
x[, "time"] Error in [.default`(x, , "time") : subscript out of bounds
as we do inside IPCweights() gives the error .
IPCweights()
Following code (similar to the one we use to generate survival data for mboost checks) breaks:
The reason seems to be, that the object
Surv(survtime, event)
does not include the appropriate names:and therefore
as we do inside
IPCweights()
gives the error .