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

small problem with IPCweights... #54

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

small problem with IPCweights... #54

mayrandy opened this issue Sep 23, 2016 · 0 comments
Labels

Comments

@mayrandy
Copy link
Member

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 .

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

No branches or pull requests

1 participant