Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upggcoxdiagnostics() is not working properly for schoenfeld residuals #122
Comments
|
Bug fixed now by the pull request #123. Thank you for pointing this out and for your work! |
Some residuals (like schoenfeld) are calculated for each failure time, not each observation.
Thus lines 91-94 will trigger an error because a data frame with schoenfeld residuals (n.rows = number of failure times) cannot be bind to vector of linear predictions for observations (=number of rows in the data).
The easiest fix is to replace
xval <- 1:fit$nbyxval <- 1:nrow(res)and change the default value for
linear.predictionse.g. bylinear.predictions = type %in% c("martingale", "score", "dfbeta", ...)Expected behaviour
Example for ggcoxdiagnostics() will work also for schoenfeld residuals
Actual behaviour
Steps to reproduce the problem