ggcmprsk {autoReg}R Documentation

Draw Cumulative Incidence Curves for Competing Risks

Description

Draw Cumulative Incidence Curves for Competing Risks

Usage

ggcmprsk(x, data, id = NULL, se = FALSE, strata = NULL, facet = NULL, ...)

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

Value

An object of class "ggplot"

Examples

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)


[Package autoReg version 0.3.3 Index]