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

small problem with IPCweights... #54

Closed
mayrandy opened this Issue Sep 23, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@mayrandy
Member

mayrandy commented Sep 23, 2016

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:

 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 .

@mayrandy mayrandy added the bug label Sep 23, 2016

@mayrandy mayrandy closed this in 4139869 Sep 23, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment