CompStat Period Comparison Tool
Actual independently harmonized CompStatcategory comparison, zero previous count has unknown-relative flag with explicit zero placeholder. Not causal effectiveness or infer true incidence from recording changes.
Description
CompStat period comparison needs matched categories and reporting periods.
CompStat period comparison needs matched categories and reporting periods.1
A zero previous count makes a relative percent change undefined even when a count difference exists. Use this tool to calculate the stated observation or conditional model from supplied measurements.
When to use CompStat Period Comparison Tool
Use this tool to calculate the stated observation or conditional model from supplied measurements. Establish the jurisdiction or research scope, observation and event definitions, reference date, matched period and denominator basis.
How to use CompStat Period Comparison Tool and understand its results
- Establish the jurisdiction or research scope, observation and event definitions, reference date, matched period and denominator basis.
- Enter callerOffenseCategoryIds, previousMatchedPeriodCounts, currentMatchedPeriodCounts, using the field meanings and rules below, then run the tool.
- Read result.signedCategoryCountChanges, result.relativeChangeKnownFlags, result.signedCategoryChangePercents. Interpret each field using the units, signs and evidence rules below.
- If input validation fails, correct the reported field and run again. Before applying a successful result, check the stated reference scope, units, assumptions and any retained unknown evidence.
| Input field | Meaning | Value type | Requirement |
|---|---|---|---|
| callerOffenseCategoryIds | Caller offense category ids | list of string | Required |
| previousMatchedPeriodCounts | Previous matched period counts | list of number | Required |
| currentMatchedPeriodCounts | Current matched period counts | list of number | Required |
Supply nonempty unique nonblank offense-category IDs with aligned nonnegative finite previous/current counts. Return current−previous per category. For positive previous values calculate percent change and known flag 1; for zero previous values return placeholder percent 0 with known flag 0. Read those flags to avoid interpreting an unavailable relative change as no change. Fractional counts are accepted.
countChange_i=current_i−previous_i; percentChange_i=previous_i>0 ? 100×countChange_i/previous_i : placeholder0; relativeKnown_i=previous_i>0 ? 1 : 0 Apply the field units and exact ordering, boundary and evidence rules above.
| Output field | Meaning | Value type |
|---|---|---|
| result | Structured result containing the calculation or selected reference fields below | object |
| result.signedCategoryCountChanges | Signed Category Count Changes; use the units, sign convention and calculation stated above | list of number |
| result.relativeChangeKnownFlags | Per-category 1 when previous count>0, otherwise 0 for undefined relative change | list of number |
| result.signedCategoryChangePercents | Signed percent changes; placeholder 0 when the paired known flag is 0 | list of number |
{
"input": {
"callerOffenseCategoryIds": [
"a",
"b"
],
"previousMatchedPeriodCounts": [
10,
0
],
"currentMatchedPeriodCounts": [
5,
3
]
},
"output": {
"result": {
"signedCategoryCountChanges": [
-5,
3
],
"relativeChangeKnownFlags": [
1,
0
],
"signedCategoryChangePercents": [
-50,
0
]
}
}
} Limitations and assumptions
A zero previous count makes a relative percent change undefined even when a count difference exists. Results depend on the independently established measurement basis and the exact model assumptions above.
Every listed input requires an explicit value. Unexpected fields, incorrect value types, nonfinite numbers and sparse numeric arrays fail validation; tool-specific bounds and alignment rules apply as described above. Extremely large inputs or outputs can also be rejected. An input error is distinct from a successful calculation that reports a false comparison or retains unknown evidence.
Alternative or Complementary methods
Use Seasonal Index Monthly Crime Calculator to examine a related aspect: Monthly seasonal indices compare recorded counts with their twelve-month mean.
Use Crime Trend Percent Change YoY Calculator where its separate inputs and scope apply: Year-on-year percent change compares recorded counts on a matched basis.
References
-
CompStat Period Comparison Tool — tool.io
Similar or alternative tools
- Seasonal Index Monthly Crime Calculator
Monthly seasonal indices compare recorded counts with their twelve-month mean.
- Crime Trend Percent Change YoY Calculator
Year-on-year percent change compares recorded counts on a matched basis.