data(hfactioncpx12)
hf <- hfactioncpx12
## Check for ties in event exit times
ev <- hf[hf$status == 1, ]
any(duplicated(ev$time))
## Resolve ties before fitting the marginal mean model
hf_clean <- tie_breaker(hf, stop = "time", start = "entry",
status = "status", id = "id",
cause = 1, cens.code = 0)
out <- recurrent_marginal(Event(entry, time, status) ~ cluster(id),
data = hf_clean, cause = 1, death.code = 2)
summary(out, times = 1:5)
Run the code above in your browser using DataLab