I am attempting to do a competing risks analysis using the package tidycmprsk in R.
My dataset is running into a problem because there are no censored cases (everyone in the dataset has experienced one of the three outcomes).
From the documentation:
The event status variable must be a factor, with the first level indicating ’censor’ and subsequent levels the competing risks.
Any ideas on how to get around this? Otherwise it's treating one of my levels/outcomes as censoring when it's actually an outcome of interest.
e.g. Below runs a cumulative incidence curve and gives results for two outcomes - death from cancer and death from other causes:
library(tidycmprsk)
cuminc(Surv(ttdeath, death_cr) ~ trt, trial)
But if you take out the censored cases, now it just gives results for one failure type thinking the other is your censored variable:
data <- trial %>%
mutate(death_cr_new = case_when(
death_cr=="censor" ~ 2,
death_cr=="death from cancer" ~ 2,
death_cr=="death other causes" ~ 3
))
data$death_cr_new<-as.factor(data$death_cr_new)
cuminc(Surv(ttdeath, death_cr_new) ~ trt, data)