Draw Cumulative Incidence Curves for Competing Risks
Arguments
- 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
Examples
data(melanoma,package="boot")
melanoma$status1 = ifelse(melanoma$status==1,1,ifelse(melanoma$status==2,0,2))
melanoma$years=melanoma$time/365
# \donttest{
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)
#> Warning: Removed 4 rows containing missing values (`geom_step()`).
ggcmprsk(years+status1~sex,data=melanoma,facet=1)
#> Warning: Removed 4 rows containing missing values (`geom_step()`).
ggcmprsk(years+status1~sex,data=melanoma,
id=c("alive","melanoma","other"),strata=c("female","male"))
#> Warning: Removed 4 rows containing missing values (`geom_step()`).
ggcmprsk(years+status1~sex,data=melanoma,
id=c("alive","melanoma","other"),strata=c("female","male"),facet=1)
#> Warning: Removed 4 rows containing missing values (`geom_step()`).
# }