I have made a cph model using survival:coxph (see below)
I am now having some difficulties using the model performance functions in the rms package.
I keep on hitting this error when running the code:
Error in if (unit == "") unit <- "Day" : argument is of length zero
Can someone advise me on this?
calibration
library(polspline)
units(data$time_event) <- "Day"
final.model <- coxph(Surv(data$time_event, data$event) ~ RANDRES + ns(AGE, 3) + aneurysmlocation + ns(LUMENSIZE, 3), data = data)
cal <- calibrate.cph(final.model, cmethod=c('hare', 'KM'),
method="boot", u, m=150, pred, B=200,
bw=FALSE, rule="aic", type="residual", sls=0.05, aics=0, force=NULL,
estimates=TRUE,
pr=FALSE, what="observed-predicted", tol=1e-12, maxdim=5)