Calculate spatial correlation of given municipalities in an incidence_rate object.
Source:R/spatiotemporal.R
morans_index.Rd
Function to calculate spatial autocorrelation via Moran's Index from a given incidence_rate object grouped by municipality.
Value
List of Moran's I clustering analysis, giving the quadrant of each observation, influential values.
Examples
data_event <- epiCo::epi_data
incidence_historic <- incidence::incidence(data_event$fec_not,
groups = data_event$cod_mun_o,
interval = "4 year"
)
incidence_object <- subset(incidence_historic,
from = "2015-01-04",
to = "2018-12-27"
)
morans_index(incidence_object, scale = 100000, threshold = 2, plot = TRUE)
#> Significant municipalities are:
#> 73024 with Low-High (incidence - spatial correlation)
#> 73226 with High-High (incidence - spatial correlation)
#> 73352 with Low-High (incidence - spatial correlation)
#> 73675 with High-High (incidence - spatial correlation)
#> $data
#> $data$municipios
#> [1] "73001" "73024" "73026" "73030" "73043" "73055" "73067" "73124" "73148"
#> [10] "73152" "73168" "73200" "73217" "73226" "73236" "73268" "73270" "73275"
#> [19] "73283" "73319" "73347" "73349" "73352" "73408" "73411" "73443" "73449"
#> [28] "73461" "73483" "73504" "73520" "73547" "73555" "73563" "73585" "73616"
#> [37] "73622" "73624" "73671" "73675" "73678" "73686" "73770" "73854" "73861"
#> [46] "73870" "73873"
#>
#> $data$quadrant
#> [1] Not Significant Low-High Not Significant Not Significant
#> [5] Not Significant Not Significant Not Significant Not Significant
#> [9] Not Significant Not Significant Not Significant Not Significant
#> [13] Not Significant High-High Not Significant Not Significant
#> [17] Not Significant Not Significant Not Significant Not Significant
#> [21] Not Significant Not Significant Low-High Not Significant
#> [25] Not Significant Not Significant Not Significant Not Significant
#> [29] Not Significant Not Significant Not Significant Not Significant
#> [33] Not Significant Not Significant Not Significant Not Significant
#> [37] Not Significant Not Significant Not Significant High-High
#> [41] Not Significant Not Significant Not Significant Not Significant
#> [45] Not Significant Not Significant Not Significant
#> Levels: High-High High-Low Low-High Low-Low Not Significant
#>
#>
#> $plot
#>