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))
上面的示例代码估算竞争风险(cif)的累积发生率,然后制作一个数据框(cifd)容纳累积发生率值。
我的问题是-
1,在存在竞争性事件2的情况下,对事件1进行完整研究的风险是否等于0.3387175?如cif所示?
2,为什么cif [[1]] $ time中事件1和事件2的cif每次都在cif [[2]] $ time中重复?