The requirement that the nodes argument is always supplied, even when there are no time varying covariates, presents a barrier to UX. The requirement exists because internally lmtp uses the length of this list to determine how many time points there are. This task could fall to the trt parameter, but this presents an issue in the case of a time-invariant survival analysis where there are multiple time points but the length of the trt argument would be 1.
I think the best solution would be to modify the outcome_type argument so as to accept a 3rd option, survival. When outcome_type is set to "binary" or "continuous" the number of time points will be derived from the trt parameter. If it is set to "survival", then the number of time points will be derived from the length of the vector supplied to cens. This would also open up a check that if the user sets outcome_type = "survival" that the outcome argument is supplied a vector.
The requirement that the
nodes
argument is always supplied, even when there are no time varying covariates, presents a barrier to UX. The requirement exists because internallylmtp
uses the length of this list to determine how many time points there are. This task could fall to thetrt
parameter, but this presents an issue in the case of a time-invariant survival analysis where there are multiple time points but the length of thetrt
argument would be 1.I think the best solution would be to modify the
outcome_type
argument so as to accept a 3rd option,survival
. Whenoutcome_type
is set to"binary"
or"continuous"
the number of time points will be derived from thetrt
parameter. If it is set to"survival"
, then the number of time points will be derived from the length of the vector supplied tocens
. This would also open up a check that if the user setsoutcome_type = "survival"
that theoutcome
argument is supplied a vector.