-
Notifications
You must be signed in to change notification settings - Fork 4
minPostCombinationDuration filters all eras, not just combination spillovers #15
Description
Describe the bug
I think it's here, per Copilot :)
TreatmentPatterns/R/constructPathways.R
Line 802 in fb4437f
| dplyr::filter(.data$durationEra >= minPostCombinationDuration | is.na(.data$durationEra)) |
To Reproduce
Run on data containing eras that are less than minPostCombinationDuration but don't overlap any other / aren't contributing to a combination. They're being dropped.
Expected behavior
minPostCombinationDuration operates per documentation: "Minimum time an event era before or after a generated combination treatment should last to be included in analysis"
I know there is a Best Practice recommendation to make minPostCombinationDuration less than minEraDuration, to prevent this silent failure mode, the recommendation should either be enforced via a constraint in the function, or the bug should be fixed.
There is a use case to have minEraDuration and minPostCombinationDuration be different. We may not expect all rx to stop at exactly the same time in a combo while also wanting to count all rx starts regardless of length.