nt-williams / lmtp

:package: Non-parametric Causal Effects Based on Modified Treatment Policies :crystal_ball:
http://www.beyondtheate.com
GNU Affero General Public License v3.0
57 stars 17 forks source link

Remove the nodes argument requirement #52

Closed nt-williams closed 4 years ago

nt-williams commented 4 years ago

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.

nt-williams commented 4 years ago

Closed with PR #53