Skip to contents

max_z (O_z/E_z)^{O_z} ((O_+ - O_z)/(E_+ - E_z))^{O_+ - O_z}, reported on the log scale and restricted by default to windows whose internal risk exceeds the overall risk.

Usage

Scanstat(O, E, zones, highonly = TRUE)

Arguments

O

Observed counts per region.

E

Expected counts per region, strictly positive.

zones

List of candidate windows, each a vector of zero-based region indices.

highonly

Score only windows with elevated internal risk.

Value

List with loglr, best (zero-based), maxloglr, bestzone, Oz, Ez, rrin, rrout, Otot, Etot, nzone.

References

Bivand, Pebesma and Gomez-Rubio (2013), Equation (10.3), p. 354, after Kulldorff and Nagarwalla (1995). Read from the corpus PDF.

Examples

Scanstat(O = c(1, 2, 3, 4, 5, 6, 7, 8), E = c(1, 2, 3, 4, 5, 6, 7, 8),
  zones = matrix(c(1, 2, 3, 4, 5, 6), nrow = 2))
#> $loglr
#> [1] -Inf -Inf -Inf -Inf -Inf -Inf
#> 
#> $best
#> [1] 0
#> 
#> $maxloglr
#> [1] -Inf
#> 
#> $bestzone
#> [1] 1
#> 
#> $Oz
#> [1] 2 3 4 5 6 7
#> 
#> $Ez
#> [1] 2 3 4 5 6 7
#> 
#> $rrin
#> [1] 1 1 1 1 1 1
#> 
#> $rrout
#> [1] 1 1 1 1 1 1
#> 
#> $Otot
#> [1] 36
#> 
#> $Etot
#> [1] 36
#> 
#> $nzone
#> [1] 6
#> 
#> $method
#> [1] "Kulldorff spatial scan statistic (Bivand et al. 2013 eq. 10.3)"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"