EcheScan User Guide
March 2020
This is partly excerpted and re-edited from Kurihara et al.(2020).

1Overview

We describe the design and implementation of software for the echelon analysis named EcheScan. The
EcheScan constructs the echelons from input data ﬁles which consists of univariate values and neighbors foreach lattice and visualizes the result of a dendrogram. It can also detect hotspot clusters based on Poissonmodel using the echelon scan technique by reading a ﬁle describing the observed and expected values of eachlattice. In addition, users can obtain the analysis results output as a ﬁle. Developed by R Shiny environment
and visualized in this web(https://fishi.ems.okayama-u.ac.jp/echescan), users can access the software
through the Internet. Table 1 summarizes the ﬁles required for input and the ﬁles that can be output.
Table 1: Input and output ﬁles of EcheScan
IO

FileI

Neighborhood information

I

Univariate

I

Case & expectationO

Echelon tableO

Lattices forming echelon

O

Echelon dendrogramO

Hotspot tableO

Echelon dendrogram with scanning

Contents
Neighbor informationof each lattice
Value (h) of each latticeObserved(c) and expected(λ)
values of each lattice
Details of echelons
Lattice information
within each echelon
Graphical representationof echelons
Details of detected hotspots
Graphical representationof echelon scan technique

1

Notes
File format: txt, csv
File format: txt
For hotspot detection
based on Poisson model
File format: txt
File format: csv
File format: csv
File format: png, pdf, eps
File format: csv
File format: png, pdf, eps

2Input ﬁles

2.1

Neighbor information ﬁle

The neighborhood information ﬁle provides the labels and neighbors of each lattice. The ﬁrst column ofeach line is the lattice label, and the next columns specify the line numbers that are neighbors of the latticedescribed in the ﬁrst column. Therefore, the total number of lines in this ﬁle is N L. For example, when“lattice1” is neighbor of “lattice2” and “lattice4”, the ﬁle becomes
lattice1
lattice2
lattice3
lattice4
...

2
1
...
1

4
...
...

To make the neighbors correspond to the opposite viewpoint, it must be written “1” (meaning “lattice1”)
in the lines of “lattice2” and “lattice4”.
Tabs and commas are allowed to separate each item.

2.2

Univariate ﬁleThe univariate ﬁle provides the values (h) of each lattice in one column. The number of lines is N L. Here,the order of each value must be identical to that of lattices in the neighborhood information ﬁle.

2.3

Case & expectation ﬁle

The case & expectation ﬁle provides the observed (c) and expected (λ) values for each lattice to detect thehotspot, which forms N L lines of two columns. Similar to the univariate ﬁle, the order must be identical tothat of lattices provided by the neighborhood information ﬁle.

2

3

Execution examples

3.1

One dimensional lattice

We introduce how to use the EcheScan for the one dimensional lattice data shown in Table 2. With thesoftware application, the neighborhood information ﬁle (dim1nb.txt) and the univariate ﬁle (dim1h.txt)
are prepared as shown in Figure 1. In Figure 1(left), for example, lattice “C” (the third line) indicates that
it is neighboring to the second line (B) and the fourth line (D).
Table 2: One dimensional spatial lattice data.
34 56789 10 11 12 13i

12ID

A

BCDEFGHIJKLh(i)1234345432

321415

M

NO

1

2

1

Figure 1: Contents of the neighborhood information ﬁle (dim1nb.txt; left) and the univariate ﬁle (dim1h.txt;right) for the one dimensional lattice data.

Figure 2: Start screen of the software.
Figure 2 shows the start screen of the software. First, we select the dim1nb.txt from [Browse . . .]of “Neighborhood information” on the left side of the screen. If there is no error in the contents of theloaded ﬁle, “Univariate” appears, and then we select the dim1h.txt. Next, when we click [Run], an echelon
analysis is executed, and the result is displayed on the [Echelon dendrogram] tab (Figure 3). The table at3the top of Figure 3 displays tabular information for each echelon. The ﬁrst ﬁelds is echelon number (EN ).
The second ﬁeld is Order, which gives an integer value greater than or equal to 1; “1” means a peak, “2”means a foundation of order 1s, “3” means a foundation of order 2s, and so on. The third ﬁeld is P arent,
which gives the echelon number of the parent. The forth ﬁeld is M axval, which gives the maximum value.
The ﬁfth ﬁeld is M inval, which gives minimum value. The sixth ﬁeld is Length, which is the length ofM axval − parent′ s M axval. The seventh ﬁeld is Cells, which gives the number of lattices. The eighth ﬁeld
is P rogeny, which gives the number of ascendants (children) for the echelon. The nineth ﬁeld is F amily,
which gives the number of echelons in the family. The ﬁnal ﬁeld is Level, which gives the number of echelons
in the ancestor. These information and dendrogram of echelons can also be output as a ﬁle. The details ofV ariable are shown in the papers of Myers et al. (1997) and Kurihara et al. (2000).

Figure 3: Execution result of echelon analysis for the one dimensional lattice data.

43.2

5-by-5 latticeTwo-dimensional lattice data such as remote sensing data are pixels of digital values over the m-by-n regularly
spaced lattice area.
Table 3: Digital values and lattice ID (right side) for a 5-by-5 lattice.
AB

CDEA

B

CDE

12824

531A1B1C1D1E121

10142215

2A2B2C2

D2E2

3

4

21

19

23

25

3A3B3C3

D3E3

4

1620

12

11

17

4A4B4C4

D4E4

5

13

697

18

5A5B5C5

D5E5

We apply the EcheScan to the 5-by-5 lattice data (m = 5, n = 5) in Table 3. Here, each cell is givena rook-type neighbor. The neighborhood information ﬁle (5by5nb.txt) and the univariate ﬁle (5by5h.txt)
we prepare are shown in Figure 4, respectively. As in the case of one dimensional lattice data, we move the5by5nb.txt to “Neighborhood information” and the 5by5h.txt to “Univariate”. By clicking on [Run], theresult of echelon table and dendrogram are displayed on the [Echelon dendrogram] tab (Figure 5).

Figure 4: Contents of the neighborhood information ﬁle (5by5nb.txt; left) and the univariate ﬁle (5by5h.txt;right) for the 5-by-5 lattice data.

5

Figure 5: Execution result of echelon analysis for the 5-by-5 lattice data.

3.3

Lung cancer data in New Mexico

As a real data analysis, we apply echelon analysis and the scanning technique to lung cancer data in New
Mexico available on the SaTScan website(https://www.satscan.org/datasets/nmlung/). The data consist
6

of the number of malignant lung cancer cases and the number of populations of 32 counties from 1973 to1991. A total of 9,254 cancer cases and 25,604,291 populations were recorded during this period, and they
are provided with separate multiple categorical covariates such as 18 age groups (1 = ages <5, 2 = ages
5–9, 3 = ages 10–14, . . ., 17 = ages 80–84, 18 = ages 85+) and sex (1 = male, 2 = female). To simplify
the interpretation of output analysis, we aggregate the years into six time periods: 1st = 1973–1975, 2nd =1976–1978, 3rd = 1979–1981, 4th = 1982–1984, 5th = 1985–1987 and 6th = 1988–1991. The cancer cases andthe populations for each data point are denoted by citjk and nitjk , respectively (county: i = 1, 2, . . . , 32; timeperiod: t = 1, 2, . . . , 6; age group: j = 1, 2, . . . , 18; sex: k = 1, 2). With covariate adjustment, the expected
number of cases in a county (i, t) is calculated using age group j and sex k.
18 ∑2∑

λit =nitjk Pjk(1)

j=1 k=1∑32 ∑6∑32 ∑6
where Pjk = i=1 t=1 citjk / i=1 t=1 nitjk is the incidence of cancer. Similarly, the standardized mortality ratio (SMR), which is the most common health index of a county (i, t) is given bySMRit =cit=λit∑18 ∑2k=1 citjk

j=1(2)

λitFigure 6 shows the spatial distribution of SMR for each time period.
15

23

15
421

31

23

421

29
25

26

1117

20

1030

25

26

28

2312

2nd period (1976-1978)

15
4

31

23

26

4

23

17

20

1025

26

11

17

20

1030

25

28

214

14

22
14

3

3
27

13

13

19

98

16

12

0.50 - 0.75

19

98

7

16

12

4th period (1982-1984)< 0.50

5
6

28

227
19

20

1030

22

327

11

24

622

7

26

1

32
5

6

31

18

24

132
5

28

94

21
29

18

1130

16

31

29
24

132

15

21

29
25

3rd period (1979-1981)

15

18

8

716

12131998716

1st period (1973-1975)

214131991217

222271321528

3820

1062227
19112430

1427
726

132
532325

61416

1720

1030

2231

18

116942124

132
528

223

29
18

24

132

31

29
181715713812

5th period (1985-1987)

0.75 - 1.00

1.00 - 1.25

6th period (1988-1991)

1.25 - 1.50

> 1.50Figure 6: SMR geographical distribution for each time period and county numbers for each of the 32 countiesof New Mexico.
The data are considered as spatio-temporal lattice data with 192 irregular lattices (32 counties × 6 timeperiods). Each lattice is denoted by l3 (i, t) (i = 1, 2, . . . , 32; t = 1, 2, . . . , 6). Here the simplest example of7

deﬁning the neighbors of l3 (i, t) is given as {l3 (k, t)|county i and k are neighbor} ∪ l3 (i, t + 1),{l3 (k, t)|county i and k are neighbor} ∪ l3 (i, t + 1) ∪ l3 (i, t − 1),N B(l3 (i, t)) ={l3 (k, t)|county i and k are neighbor} ∪ l3 (i, t − 1),

t=1
1<t<6t=6(3)Spatial scan statistics
Several models have identiﬁed areas with statistically signiﬁcantly high values (hotspots) for a spatiallydistributed response variable. The spatial scan statistics (Kulldorﬀ 1997) detect the disease cluster used inepidemiologic and disease surveillance studies. The spatial scan statistic detects the hotspots or clustersof lattices by use of scan window Z on each centroid of aggregated lattices. Let the lattice in Zi be theconnected subset of index set D and satisfy D = ∪M
i=1 Zi , i = 1, 2, . . . , M . We deﬁne a family of a subset
Z = {Z1 , Z2 , . . . , ZM },Zi ⊂ D(4)as candidates of a hotspot. The hypothesis is threre is no hotspot under the null hypothesis H0 , versus
alternative hypothesis H1 where there is at least one window Z of the hotspot. We ﬁnd the window Ẑ thatmaximize the likelihood function L(Z). The test statistic is based on the likelihood ratio (LR),LR(Z) =L(Ẑ)
the likelihood under H1=the likelihood under H0L0(5)The logarithm of LR(Z), (i.e, LLR) is for computational simplicity. We deﬁne a hotspot as a window Z witha maximum value of LLR. Some probability models of spatial scan statistic have been proposed dependingon the feature of data so far. For example, LR based on Poisson model can be deﬁned in)c(Z) ()c−c(Z) ()(c − c(Z)c(Z)
c − c(Z)
c(Z)
I>
(6)
LR(Z) =λ(Z)c − λ(Z)λ(Z)
c − λ(Z)where c(Z) and λ(Z) denote a observed number of cases and an expected number of cases, respectively, within
the speciﬁed window Z. c is a total number of the observed number of cases. I() is the indicator function.
To evaluate the statistical signiﬁcance of detected hotspots, Monte Carlo test under the null hypothesis is
typically used to estimate p-values since it is diﬃcult to obtain the exact distribution of the spatial scanstatistic.

Echelon scan technique
The scan window is an important research topic that satisﬁes several properties to detect a candidate of ahotspot. First, the window should comprise a geographically connected subset of the index set. Second,
the window should be medium. This restriction is achieved by limiting the hotspot search to lattice that
does not comprise more than 50% of the lattices. The diﬃcult part of hotspot estimation lies in maximizing
LLR as Z varies over the collection of all lattices in Z. The family of subset Z is a ﬁnite set that has highcomputational costs to maximize LLR through an exhaustive search. The traditional spatial scan statistic
uses expanding circles to determine the candidate of window Z. The candidate window Z may do a poor jobof approximating actual hotspots. The echelon scan technique (Kurihara 2003, Ishioka and Kurihara 2012)
has been proposed to reduce the size of the scanned window Z and computational costs. This technique isperformed to ﬁnd the candidate of the hotspot by scanning from the peak .

Space-time hotspot detection using EcheScan
We use the EcheScan for the detection of space-time hotspot of the lung cancer data in New Mexico. First,we prepare the neighborhood information ﬁle (NMnb.txt) and the univariate ﬁle (NMsmr.txt) for the echelon
analysis, and also use the case & expectation ﬁle (NMCasExp.txt) to calculate the spatial scan statistics asshown in Figure 7.
8

Figure 7: Part of the contents of the neighborhood information ﬁle (NMnb.txt; left), univariate ﬁle(NMsmr.txt; center) and case & expectation ﬁle (NMCasExp.txt; right). These ﬁles consist of 192 lines. Eachlattice label is given by “(county number, time period)”. For example, “(1,1)” corresponds to the county 1 at
the 1st period. The univariate ﬁle consists of SMR. In the case & expectation ﬁle, the two values of cit andλit corresponding to each lattice (the each line) are described.
If the neighbor information and univariate data succeed in reading without error, “Case & Expectation”
appears. By clicking on “Case & Expectation”, we select the NMCasExp.txt for the case & expectation ﬁle.
Next, we click on the [Echelon scan] tab and click on [Run] to execute the echelon scan technique. Figure 8
shows the execution result when setting the signiﬁcance level = 0.05, the maximum hotspot size = 30, andthe Monte Carlo replications = 999. By changing the settings of “Vertical range:” and “Horizontal range:”at the bottom of the screen, we can display part of the echelon dendrogram interactively. Figure 9 is anenlarged view of the echelons and the lattices recognized as the hotspot.
The detected hotspot cluster has LLR = 93.883 and p = 0.001, and we visualized it on the map using
ArcMap software by Esri. As shown in Figure 10, the echelon scan technique revealed that the counties
recognized as the hotspot cluster have a complex variation over time. There were no hotspot counties in the1st period, but as time goes on, we can see that it spreads in the southeast beginning at the county 8. The
hotspot counties in the southwest centered on the county 16 was detected based on the 4th period, and at
this period the hotspot was covered a wide range from east to west. Furthermore, it can be seen that thehotspot was split east and west after the 5th period.

Note• Each input ﬁle is allowed up to 5MB.
• In a 10 × 10 lattice data with randomly generated observed and expected values, the average execution
time and its SD for hotspot detection of 50 trials were 12.72 seconds and 0.34 respectively when we set to themaximum hotspot size = 50% of the total lattices and 999 Monte Carlo replications (using a google chromebrowser on a PC windows7 Intel(R), Core(TM)i7 CPU X990 (3.47GHz) and 24GB memory).
• Figure 6 and Figure 10 are drawn using Esri’s arcmap software.

9Figure 8: Execution result of hotspot detection using the echelon scan technique for lung cancer data in NewMexico.

10

Figure 9: Enlarged view of the echelons in which the hotspot was recognized.

11203230
6332727
13138881612

1st period (1973-1975)

2nd period (1976-1978)

3rd period (1979-1981)

3232

32

2030

30
628
143332727
13

13888161616

4th period (1982-1984)

5th period (1985-1987)

6th period (1988-1991)

12Figure 10: Detected hotspot cluster of malignant lung cancer data in New Mexico. County numbers of thehotspot are indicated. 1st period: no counties are detected; 2nd period: 1 county; 3rd period: 5 counties;
4th period: 9 counties; 5th period: 5 counties; 6th period: 9 counties.

References
Ishioka, F., Kawahara, J., Mizuta, M., Minato, S., & Kurihara, K. (2019). Evaluation of hotspot cluster
detection using spatial scan statistic based on exact counting Japanese Journal of Statistics and Data Science,2(1), 241–262. DOI: 10.1007/s42081-018-0030-6
Ishioka, F., & Kurihara, K. (2012). Detection of spatial clustering using echelon scan. Proceedings of the20th International Conference on Computational Statistics (COMPSTAT2012) (Edited by Colubi, A. et al.),Heidelberg : Physica-Verlag, 341–352.
Kulldorﬀ, M. (1997). A spatial scan statistic. Communications in Statistics: Theory and Methods, 26(6),1481–1496. DOI: 10.1080/03610929708831995
Kurihara, K., Myers, W. L., & Patil, G. P. (2000). Echelon analysis of the relationship between population and land cover patterns based on remote sensing data. Community Ecology, 1, 103–122. DOI:
10.1556/ComEc.1.2000.1.14
Kurihara, K. (2003) The detection of hotspots based on the hierarchical spatial structure. Bulletin of theComputational Statistics of Japan, 15(2), 171–183. DOI: 10.20551/jscswabun.15.2 171
Myers, W. M., Patil, G. P., & Joly, K. (1997). Echelon approach to areas of concern in synoptic regionalmonitoring. Environmental and Ecological Statistics, 4, 131–152. DOI: 10.1023/A:1018518327329

12