powered by
Convenience wrapper around residuals.spbp that returns a ggplot2 object for martingale, deviance, or Cox-Snell residuals.
residuals.spbp
ggresiduals( object, type = c("martingale", "deviance", "cox-snell", "coxsnell"), against = c("fitted", "index"), ... )
A ggplot object (requires ggplot2).
ggplot
A fitted "spbp" object.
"spbp"
Residual type: "martingale" (default), "deviance", "cox-snell", or "coxsnell".
"martingale"
"deviance"
"cox-snell"
"coxsnell"
What to plot on the x-axis: "fitted" (default, Cox-Snell cumulative hazard) or "index" (observation index).
"fitted"
"index"
Further arguments passed to residuals.spbp.
if (FALSE) { library(spsurv) library(ggplot2) data(veteran, package = "survival") fit <- bpph(Surv(time, status) ~ karno, data = veteran, degree = 4) ggresiduals(fit, type = "martingale") }
Run the code above in your browser using DataLab