View source: R/filter_clusters.R
| filter_clusters | R Documentation |
Removes overlapping secondary clusters from the output of
treespatial_scan, circular_scan, or
tree_scan.
filter_clusters(result, alpha = NULL)
result |
An object of class |
alpha |
Numeric. Significance level. Default is |
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).
A data.frame of distinct significant clusters ordered by
descending LLR.
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")}
treespatial_scan, circular_scan,
tree_scan, iterative_scan
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.