
Last chance! 50% off unlimited learning
Sale ends in
ggcoxzph(fit, resid = TRUE, se = TRUE, df = 4, nsmo = 40, var, point.col = "red", point.size = 1, point.shape = 19, point.alpha = 1, font.main = c(16, "plain", "black"), font.x = c(14, "plain", "black"), font.y = c(14, "plain", "black"), font.tickslab = c(12, "plain", "black"), ggtheme = theme_classic2())
"print"(x, ...)
theme
.ggcoxzph
which is a list of ggplots.
ggcoxzph
: Graphical Test of Proportional Hazards using ggplot2.
library(survival)
fit <- coxph(Surv(futime, fustat) ~ age + ecog.ps + rx, data=ovarian)
cox.zph.fit <- cox.zph(fit)
# plot all variables
ggcoxzph(cox.zph.fit)
# plot all variables in specified order
ggcoxzph(cox.zph.fit, var = c("ecog.ps", "rx", "age"))
# plot specified variables in specified order
ggcoxzph(cox.zph.fit, var = c("ecog.ps", "rx"))
Run the code above in your browser using DataLab