openpharma / crmPack

Object-Oriented Implementation of CRM Designs
https://openpharma.github.io/crmPack/
20 stars 10 forks source link

`DataDA` does not allow zero follow-up time #850

Closed Puzzled-Face closed 1 month ago

Puzzled-Face commented 3 months ago

If a DADesign's model is updated on the same day as a participant enrols (so that this participant's follow-up time is zero), the following error is reported:

Error in `validObject()`:
! invalid class "DataDA" object: u must be of type double, nObs length, non-negative and not greater than Tmax

u is a vector of DLT-free survival times.

This seems unnecessarily strict: two participants might well enrol on the same day. Or what if a participant immediately reports a DLT? Is there a technical reason why survival must be strictly positive? If not, I feel the us should simply be non-negative rather than strictly positive.

The error message is also inconsistent with the code, the relevant part of which is:

  v$check(
    test_numeric(object@u, upper = object@Tmax, len = object@nObs, any.missing = FALSE) &&
      all(object@u > 0),
    "u must be of type double, nObs length, non-negative and not greater than Tmax"
  )

815 may be related.

Puzzled-Face commented 3 months ago

Blocked by #852.