ggcmprsk | R Documentation |
Draw Cumulative Incidence Curves for Competing Risks
ggcmprsk(x, data, id = NULL, se = FALSE, strata = NULL, facet = NULL, ...)
x |
A formula as time+status~1 |
data |
A data.frame |
id |
character vector label for status |
se |
logical whether or not show confidence interval |
strata |
character vector label for strata |
facet |
numeric if facet is not NULL, draw plot with selected facets |
... |
Further arguments to be passed to tidycmprsk::cuminc |
An object of class "ggplot"
data(melanoma,package="boot")
melanoma$status1 = ifelse(melanoma$status==1,1,ifelse(melanoma$status==2,0,2))
melanoma$years=melanoma$time/365
ggcmprsk(years+status1~1,data=melanoma)
ggcmprsk(years+status1~1,data=melanoma,id=c("alive","melanoma","other"),se=TRUE)
ggcmprsk(years+status1~sex,data=melanoma)
ggcmprsk(years+status1~sex,data=melanoma,facet=1)
ggcmprsk(years+status1~sex,data=melanoma,
id=c("alive","melanoma","other"),strata=c("female","male"))
ggcmprsk(years+status1~sex,data=melanoma,
id=c("alive","melanoma","other"),strata=c("female","male"),facet=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.