Reconcile binary inspection denominators and machine-hour exposure before making a warehouse quality claim.
Project: audit rare damage and machine stoppage reports
Split two different estimands
A warehouse dashboard places package damage and machine stoppages under one incident tile. Rebuild them separately. Package damage is a binary outcome among eligible inspected packages; stoppages are event counts over operating machine-hours. Freeze inspection selection, event confirmation, deduplication and observation windows. A numerator may be correct while its denominator is wrong. The damage interval and the exposure rate answer different questions.
Trace a suspicious zero
The latest damage sample has no confirmed failures among 47 inspected packages. Report zero observed damage with a nonzero upper interval bound, not a guaranteed clean warehouse. Most inspected packages came from one supplier batch; document that dependence and obtain a broader sample before generalizing. One shift recorded an extra scan for each package, which should not double the trial count. Batch-level uncertainty matters if the supplier link is strong.
Repair the operating clock
The south warehouse shows fewer stoppages than north, but its meter lost operating-hour events during a gateway outage. Raw counts suggest an improvement; the valid exposure periods imply the same observed rate in the training example. Separate confirmed exposure from missing intervals and do not manufacture hours from a wall-clock duration. A missingness audit should name the responsible telemetry owner. Observation-process checks limit the comparison.
Gate the claim
Publish counts, inspected and operating denominators, interval method, supplier-batch coverage and telemetry completeness. Hold a cross-warehouse improvement claim until both denominators are reconciled and uncertainty is reviewed. A later intervention study needs a design for maintenance and supplier changes. The packet should link to interval interpretation and count-model diagnostics rather than a single green status badge.
Implementation
def warehouse_report_gate(report, limits):
if report["duplicate_package_scans"]:
return "hold:inspection-denominator"
if report["machine_hour_coverage"] < limits["minimum_hour_coverage"]:
return "hold:exposure-clock"
if report["supplier_batches"] < limits["minimum_batches"]:
return "review:cluster-support"
if report["damage_upper_bound"] > limits["maximum_damage_bound"]:
return "hold:damage-uncertainty"
return "publish:scoped-rates"
limits = {"minimum_hour_coverage": 0.96, "minimum_batches": 5,
"maximum_damage_bound": 0.07}
report = {"duplicate_package_scans": False, "machine_hour_coverage": 0.89,
"supplier_batches": 7, "damage_upper_bound": 0.076}
assert warehouse_report_gate(report, limits) == "hold:exposure-clock"
assert warehouse_report_gate({**report, "machine_hour_coverage": 0.99},
limits) == "hold:damage-uncertainty"
Performance and operating cost
The gate is O(1) time and space after source reconciliation. Restoring machine-hour telemetry and inspecting more supplier batches cost far more than calculating a fraction. A low-cost dashboard shortcut would leave the operational claim dependent on an unobserved denominator.
Common Mistakes
- Combining event-per-hour and damaged-package percentages as if they share a denominator.
- Counting duplicate scans as new inspected packages.
- Replacing missing operating hours with elapsed calendar hours.
- Treating zero observed damage as a zero-width uncertainty interval.
Read next
- Rare proportions: keep interval uncertainty visible at zero and one
- Event counts and exposure: compare rates across unequal observation time
- Confidence intervals: interpret coverage and precision honestly
- Standard error and cluster bootstrap: resample the independent unit
- Missingness mechanisms: model why a value is absent
Continue the workflow: Project: monitor parcel damage without confusing mix and measurement shifts.
