Statistical Methods
Test boundary ownership before assigning numeric bands
Define the task
Write the band definitions using inequalities and identify the status of values beyond both outer limits. Use a test set containing one value exactly on every edge, one value just to either side at the measurement resolution, and a missing value. These probes catch changes to an extract even when the overall distribution looks stable.
Carry out the check
For left-closed, right-open bands an interior edge belongs to the band beginning there. The default R interval index counts how many ordered breakpoints are at or below the probe. An exterior index is a signal to apply your documented overflow policy. Forcing exterior observations into the nearest band can hide impossible values.
Worked hypothetical example
With hypothetical breaks 0, 10 and 20, the probes −1, 0, 10 and 20 return default indices 0, 1, 2 and 3. If the last allowable measurement is exactly 20 and the final band is closed, its expected result changes to band 2. Record this exception in the test cases and give missing records their own status.
Method checked 10 November 2026 against R documentation: Find Interval Numbers or Indices.