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.
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?
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:
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 clusterstie-breakingties in distance are broken by coordinate (y then x), and all intermediate windows are evaluated, matching SaTScan exactly04 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:
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 memberobserved / expectedobserved cases and cases expected under the nullrelative riskinside-vs-outside case-rate ratioLLR, p-valuethe test statistic and its Monte-Carlo p-valuerank1 for the most-likely cluster, then secondaries by descending LLRA 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.
§ references
- Kulldorff, M. (1997). A spatial scan statistic. Communications in Statistics, Theory and Methods, 26(6), 1481-1496.
- Kulldorff, M., & Nagarwalla, N. (1995). Spatial disease clusters: detection and inference. Statistics in Medicine, 14(8), 799-810.
- Dwass, M. (1957). Modified randomization tests for nonparametric hypotheses. Annals of Mathematical Statistics, 28(1), 181-187.
- Kulldorff, M. SaTScan: software for the spatial, temporal, and space-time scan statistics. Version 10.3.2. satscan.org