Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

as_ped with CR cuts off times after the last event where status == 1L if using tdcs #221

Open
jonas-schropp opened this issue May 6, 2022 · 0 comments

Comments

@jonas-schropp
Copy link

If I try to use as_ped to build my competing risks data set with time dependent covariates, the follow up time is cut short at the last event time where status == 1L and any events for status > 1L (as well as censoring after that time, status == 0L) are ignored.

Example:

dat <- data.frame(
  id = factor(1:10),
  status = c(0L, 1L, 2L, 0L, 1L, 2L, 1L, 0L, 0L, 2L),
  time = seq(from = 10, to = 100, by = 10)
)

tdcs <- data.frame(
  id = factor(c(1:10, 1:10)),
  var = rbinom(20, 1, 0.3),
  tt = c(rep(0, 10), seq(5, 23, 2))
)


ped_dat <- as_ped(
  data = list(dat, tdcs),
  formula = Surv(time, status) ~ concurrent(var, tz_var = "tt"), 
  id = "id"
)

max(ped_dat$tend)

Returns [1] 70 when it should return 100.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant