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

  1. Establish the jurisdiction or research scope, observation and event definitions, reference date, matched period and denominator basis.
  2. Enter callerOffenseCategoryIds, previousMatchedPeriodCounts, currentMatchedPeriodCounts, using the field meanings and rules below, then run the tool.
  3. Read result.signedCategoryCountChanges, result.relativeChangeKnownFlags, result.signedCategoryChangePercents. Interpret each field using the units, signs and evidence rules below.
  4. 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 fieldMeaningValue typeRequirement
callerOffenseCategoryIdsCaller offense category idslist of stringRequired
previousMatchedPeriodCountsPrevious matched period countslist of numberRequired
currentMatchedPeriodCountsCurrent matched period countslist of numberRequired

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 fieldMeaningValue type
resultStructured result containing the calculation or selected reference fields belowobject
result.signedCategoryCountChangesSigned Category Count Changes; use the units, sign convention and calculation stated abovelist of number
result.relativeChangeKnownFlagsPer-category 1 when previous count>0, otherwise 0 for undefined relative changelist of number
result.signedCategoryChangePercentsSigned percent changes; placeholder 0 when the paired known flag is 0list of number
json
{
  "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

  1. CompStat Period Comparison Tool — tool.io

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies