First, thank you for your work on pammtools. In preparation for analysis where I don't really know whether the time-varying covariates will have a concurrent or cumulative effect (ie both are possible, and I was planning on selecting the 'best' effect through AIC), I am trying to run the following code :
ped_pbc2 <- as_ped(
data = list(pbc, pbcseq),
formula = Surv(time, status) ~ . +
concurrent(bili, tz_var = "day", suffix = "concur") +
concurrent(bili, tz_var = "day", lag = 10, suffix = "concurlag10") +
cumulative(latency(day), bili, tz_var = "day", suffix = "cumul"),
id = "id"
)
Things seem to work as intended with each of the 'special' formula components taken individually, but when I run the code as above, I get the following message / error :
New names:
• `bili` -> `bili...11`
• `bili` -> `bili...12`
New names:
• `bili` -> `bili...14`
Error in `map()`:
ℹ In index: 1.
Caused by error in `if (col_vars[i] == func$latency_var) ...`:
! argument is of length zero
Run `rlang::last_trace()` to see where the error occurred.
-
The initial comment about new names makes me think that the suffix argument is ignored... Indeed, this argument appears in some of the examples of the documentation website, but not in the function description / help page. Side note: this is also the case for the id argument in as_ped() ...
-
More importantly, I don't really understand why this code doesn't work... I kind of have the impression that this is somewhat related to the suffix argument.... But I might as well misunderstand something completely and maybe my approach/intention here is simply wrong , and I would appreciate any pointer with respect to the best way to do this...
First, thank you for your work on pammtools. In preparation for analysis where I don't really know whether the time-varying covariates will have a concurrent or cumulative effect (ie both are possible, and I was planning on selecting the 'best' effect through AIC), I am trying to run the following code :
Things seem to work as intended with each of the 'special' formula components taken individually, but when I run the code as above, I get the following message / error :
The initial comment about new names makes me think that the
suffixargument is ignored... Indeed, this argument appears in some of the examples of the documentation website, but not in the function description / help page. Side note: this is also the case for theidargument inas_ped()...More importantly, I don't really understand why this code doesn't work... I kind of have the impression that this is somewhat related to the suffix argument.... But I might as well misunderstand something completely and maybe my approach/intention here is simply wrong , and I would appreciate any pointer with respect to the best way to do this...