if (require("survival", quietly = TRUE)) {
sr <- survreg(Surv(futime, fustat) ~ ecog.ps + rx, ovarian,
dist="exponential")
td <- tidy(sr)
augment(sr, ovarian)
augment(sr)
glance(td)
# coefficient plot
library(ggplot2)
ggplot(td, aes(estimate, term)) + geom_point() +
geom_errorbarh(aes(xmin = conf.low, xmax = conf.high), height = 0) +
geom_vline()
}
Run the code above in your browser using DataLab