# Cumulative Incidence Rate in R Statistics

library(cmprsk)
library(MASS)
data(Melanoma)
Melanoma$$event <- NA Melanoma$$event[Melanoma$$status == 2] <- 0 Melanoma$$event[Melanoma$$status == 1] <- 1 Melanoma$$event[Melanoma$status == 3] <- 2 cif=cuminc(ftime=Melanoma$$time, fstatus=Melanoma$$event,cencode=0) cifd <- data.frame( cause = factor(rep(c(2, 1),c(length(cif[[1]]$$time), length(cif[[2]]$$time)))), time = c(cif[[1]]$$time, cif[[2]]$$time), cif = c(cif[[1]]$$est, cif[[2]]$$est))  this above sample code estimates cumulative incidence for competing risk (cif) and then makes a data frame (cifd) to house cumulative incidence values. my questions are- 1, Is the risk over the complete study of event 1 = 0.3387175 in the presence of competing event 2 ? As indicated by cif? 2, Why is it that the cif duplicates each time in the list cif[[1]]$time for event 1 and event 2 in cif[[2]]$time ? ## 1 Answer Hey @bvowe in terms of your first question, the result is print(cif) Estimates and Variances:$est
1000       2000       3000      4000      5000
1 1 0.12745714 0.23013963 0.30962017 0.3387175 0.3387175
1 2 0.03426709 0.05045644 0.05811143 0.1059471 0.1059471

\$var
1000         2000         3000        4000        5000
1 1 0.0005481186 0.0009001172 0.0013789328 0.001690760 0.001690760
1 2 0.0001628354 0.0002451319 0.0002998642 0.001040155 0.001040155


which presents there is just one group with 2 events, where from est you can tell that cumulative incidence function for event 1 after 5000 days is 0.3387175. It is not improper to say it's a risk of event 1 in the presence of event 2` since that's what the cumulative incidence function shows https://clincancerres.aacrjournals.org/content/13/2/559

For you second question: estimates for both events are present for all the observed times, that's why the times are the same for 2 events.