filter_clusters: Filter Overlapping Secondary Clusters

View source: R/filter_clusters.R

filter_clustersR Documentation

Filter Overlapping Secondary Clusters

Description

Removes overlapping secondary clusters from the output of treespatial_scan, circular_scan, or tree_scan.

Usage

filter_clusters(result, alpha = NULL)

Arguments

result

An object of class "treespatial_scan", "circular_scan", or "tree_scan".

alpha

Numeric. Significance level. Default is NULL (uses alpha from the original analysis).

Details

treespatial_scan: two clusters overlap if they have BOTH tree overlap (ancestor/descendant) AND spatial overlap (same center or identical regions). Follows Cancado et al. (2025).

circular_scan: Kulldorff (1997) criterion — center of candidate not in any retained zone, and no retained center in the candidate zone.

tree_scan: a secondary cluster is distinct if its node is NOT an ancestor or descendant of any previously retained node. Follows Kulldorff et al. (2003).

Value

A data.frame of distinct significant clusters ordered by descending LLR.

References

Kulldorff, M. (1997). A spatial scan statistic. Communications in Statistics, 26(6), 1481-1496.

Kulldorff, M., Fang, Z., & Walsh, S. J. (2003). A tree-based scan statistic for database disease surveillance. Biometrics, 59(2), 323-331.

Cancado, A. L. F., Oliveira, G. S., Quadros, A. V. C., & Duczmal, L. (2025). A tree-spatial scan statistic. Environmental and Ecological Statistics, 32, 953–978. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s10651-025-00670-w")}

See Also

treespatial_scan, circular_scan, tree_scan, iterative_scan

Examples

data(london_collisions); data(london_tree)
result <- treespatial_scan(
  cases       = london_collisions$cases,
  population  = london_collisions$population,
  region_id   = london_collisions$region_id,
  x           = london_collisions$x,
  y           = london_collisions$y,
  node_id     = london_collisions$node_id,
  tree        = london_tree,
  nsim        = 99, seed = 42
)
filter_clusters(result)

treeSS documentation built on May 16, 2026, 1:08 a.m.