MESA
home / methods / scan

Bernoulli spatial scan

The spatial scan statistic looks for a region where cases are unusually concentrated relative to controls. MESA implements Kulldorff's Bernoulli (case/control) model, scanning circular windows of growing size and testing each with a likelihood-ratio statistic and Monte-Carlo inference.

on this page
  1. 1The case/control model
  2. 2Likelihood-ratio statistic
  3. 3Candidate windows
  4. 4Monte-Carlo inference
  5. 5Cluster output
  6. 6SaTScan parity

01 the case/control model

In the Bernoulli model12 every location holds some number of cases and some number of controls (non-cases). There is no external population denominator; cases are compared against controls. The scan asks: is there a circular region where the case proportion inside is higher than outside by more than chance would produce?

MESA's scan is one-sided: it detects high-rate clusters (hot spots) only. A window whose internal case rate is at or below the overall rate scores zero and is never reported as a cluster.

02 the likelihood-ratio statistic

Each candidate window is scored by the log of the likelihood ratio between a model where the window has its own elevated rate and the null where the rate is uniform. For a window containing c cases out of n people, in a study area of C cases out of N:

Bernoulli log-likelihood ratio\[ \begin{aligned} \mathrm{LLR} = {}& c\log\tfrac{c}{n} + (n-c)\log\tfrac{n-c}{n} \\ &+ (C-c)\log\tfrac{C-c}{N-n} + \big((N-n)-(C-c)\big)\log\tfrac{(N-n)-(C-c)}{N-n} \\ &- \Big[\, C\log\tfrac{C}{N} + (N-C)\log\tfrac{N-C}{N} \,\Big] \end{aligned} \]

The window with the largest LLR over all candidates is the most-likely cluster. MESA also reports the relative risk, the ratio of the case rate inside the window to the case rate outside it, and the expected case count under the null, C · n/N. Sums that could underflow use an x·log(x) helper that is defined to be 0 at 0.

03 candidate windows

Windows are circular and centered on each location. For a given center, the other locations are sorted by distance and added one at a time, so every concentric circle from the smallest to the largest allowed becomes a candidate window. A window stops growing once its population exceeds the maximum cluster size.

max cluster sizea fraction of the total population, default 50% (Kulldorff's recommended, SaTScan-compatible default); optionally an absolute population cap. Smaller caps (10%, 25%) favor tighter local clusters
tie-breakingties in distance are broken by coordinate (y then x), and all intermediate windows are evaluated, matching SaTScan exactly

04 Monte-Carlo inference

Because the maximum LLR is taken over a very large number of overlapping windows, its null distribution has no closed form. MESA obtains a p-value by simulation3: it repeatedly reassigns the fixed total number of cases at random among all people (conditioning on the total case count), recomputes the maximum LLR each time, and compares:

Monte-Carlo p-value\[ p = \frac{1 + \#\{\, \mathrm{maxLLR}_{\text{perm}} \ge \mathrm{maxLLR}_{\text{obs}} \,\}}{1 + \text{replications}} \]

The default is 999 replications. Each replication draws cases without replacement using Floyd's algorithm and MESA's portable bounded-integer primitive rather than the standard library, so the whole simulation is bit-identical across platforms and core counts (see reproducibility). Secondary clusters are scored against the same null distribution of maximum LLRs, and by default reported clusters may not share any location (the strictest, no-geographical-overlap criterion).

05 cluster output

Each detected cluster reports:

center, radiusthe projected center and display (WGS84) coordinate, and the distance to the farthest member
observed / expectedobserved cases and cases expected under the null
relative riskinside-vs-outside case-rate ratio
LLR, p-valuethe test statistic and its Monte-Carlo p-value
rank1 for the most-likely cluster, then secondaries by descending LLR

A post-hoc diagnostic flag may annotate a cluster, but it is computed after the scan and never affects inference or which clusters are selected.

06 parity with SaTScan

MESA deliberately mirrors SaTScan's behavior4 so results are comparable and reproducible: candidate generation, tied-distance handling, relative-risk calculation, and the Monte-Carlo inference all follow SaTScan's conventions. In MESA's validation suite, the Bernoulli scan showed no discrepancies against SaTScan 10.3.2.

Read this parity claim narrowly. It means no discrepancies were observed on the tested datasets against the pinned SaTScan version (10.3.2); it does not mean the two are provably identical for every possible input.

§ references

  1. Kulldorff, M. (1997). A spatial scan statistic. Communications in Statistics, Theory and Methods, 26(6), 1481-1496.
  2. Kulldorff, M., & Nagarwalla, N. (1995). Spatial disease clusters: detection and inference. Statistics in Medicine, 14(8), 799-810.
  3. Dwass, M. (1957). Modified randomization tests for nonparametric hypotheses. Annals of Mathematical Statistics, 28(1), 181-187.
  4. Kulldorff, M. SaTScan: software for the spatial, temporal, and space-time scan statistics. Version 10.3.2. satscan.org
← Gi* & Moran's I methods →