Created
March 10, 2015 13:19
-
-
Save nutterb/fb19644cc18c4e64d12a to your computer and use it in GitHub Desktop.
Examples using ggSurvGraph
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#* You'll have to source in the function code from the gist | |
#* https://gist.github.com/nutterb/004ade595ec6932a0c29 | |
library(ggplot2) | |
install.packages("KMsurv") | |
data(kidney, package="KMsurv") | |
fit <- survfit(Surv(time, delta) ~ type, data=kidney) | |
ggSurvGraph(fit) | |
ggSurvGraph(fit, conf.bar=FALSE) | |
ggSurvGraph(fit, conf.bar=FALSE, | |
gg_expr=list(geom_rect(aes(xmin=time, xmax=next.time, | |
ymin=lower, ymax=upper, | |
fill=strata), | |
alpha=.25, linetype=0))) | |
ggSurvGraph(fit, conf.bar=FALSE, | |
n.risk=TRUE, n.event=TRUE, | |
gg_expr=list(geom_rect(aes(xmin=time, xmax=next.time, | |
ymin=lower, ymax=upper, | |
fill=strata), | |
alpha=.25, linetype=0))) | |
ggSurvGraph(fit, conf.bar=FALSE, times=seq(0, 30, by=6), | |
n.risk=TRUE, n.event=TRUE, | |
gg_expr=list(geom_rect(aes(xmin=time, xmax=next.time, | |
ymin=lower, ymax=upper, | |
fill=strata), | |
alpha=.25, linetype=0))) | |
ggSurvGraph(fit, conf.bar=FALSE, times=seq(0, 30, by=6), | |
n.risk=TRUE, n.event=TRUE, cum.inc=TRUE, | |
gg_expr=list(geom_rect(aes(xmin=time, xmax=next.time, | |
ymin=lower, ymax=upper, | |
fill=strata), | |
alpha=.25, linetype=0))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment