Emerging Hot Spot Analysis identifies trends in spatial clustering over a period of time. Emerging hot spot analysis combines the Getis-Ord Gi* statistic with the Mann-Kendall trend test to determine if there is a temporal trend associated with local clustering of hot and cold spots.
Usage
emerging_hotspot_analysis(
x,
.var,
k = 1,
include_gi = FALSE,
nb_col = NULL,
wt_col = NULL,
nsim = 199,
threshold = 0.01,
...
)
Arguments
- x
a spacetime object and must be a spacetime cube see details for more.
- .var
a numeric vector in the spacetime cube with no missing values.
- k
default
1
. The number of time lags to include in the neighborhood for calculating the local Gi*. See details for more.- include_gi
default
FALSE
. IfTRUE
, includes the local Gi* calculations in the attributegi_star
.- nb_col
Optional. Default
NULL
. The name of the column in thegeometry
context ofx
containing spatial neighbors. IfNULL
, Queen's contiguity neighbors are identified.- wt_col
Optional. Default
NULL
. The name of the column in thegeometry
context ofx
containing spatial weights. IfNULL
, row standardized weights are used.- nsim
default
199
. The number of simulations to run in calculating the simulated p-value for the local Gi*.- threshold
default
0.01
. The significance threshold to use.- ...
unused.
Details
How Emerging Hot Spot Analysis Works
Emerging Hot Spot Analysis is a somewhat simple process. It works by first calculating the Gi* statistic for each location in each time period (time-slice). Next, for each location across all time-periods, the Mann-Kendall trend test is done to identify any temporal trend in Gi* values over all time periods. Additionally, each location is classified into one of seventeen categories based on ESRI's emerging hot spot classification criteria.
The Mann-Kendall trend test is done using Kendall::MannKendall()
. Kendall
is not installed with sfdep and should be installed prior to use.
Using your own neighbors and weights
If you would like to use your own neighbors and weights, they must be created
in the geometry
context of a spacetime object. The arguments nb_col
and wt_col
must both be populated in order to use your own neighbor and weights
definitions.
Time lagged neighbors
In addition to identifying neighbors in space, emerging hotspot analysis also
incorporates the same observations from k
periods ago-called a time lag. If
the time lag k is 1 and the unit of time is month, the neighbors for the
calculation of Gi* would include the spatial neighbors' values at time t
and the same spatial neighbors' values at time t-1
. If k = 2
, it would include
t
, t-1
, and t-2
.
Examples
df_fp <- system.file("extdata", "bos-ecometric.csv", package = "sfdep")
geo_fp <- system.file("extdata", "bos-ecometric.geojson", package = "sfdep")
# read in data
df <- readr::read_csv(df_fp, col_types = "ccidD")
geo <- sf::read_sf(geo_fp)
# Create spacetime object called `bos`
bos <- spacetime(df, geo,
.loc_col = ".region_id",
.time_col = "time_period")
# conduct EHSA
ehsa <- emerging_hotspot_analysis(
x = bos,
.var = "value",
k = 1,
nsim = 9
)
ehsa
#> # A tibble: 168 × 4
#> location tau p_value classification
#> <chr> <dbl> <dbl> <chr>
#> 1 25025010405 0.111 0.721 no pattern detected
#> 2 25025010404 -0.333 0.210 no pattern detected
#> 3 25025010801 -0.200 0.474 no pattern detected
#> 4 25025010702 -0.600 0.0200 no pattern detected
#> 5 25025010204 -0.467 0.0736 no pattern detected
#> 6 25025010802 -0.333 0.210 no pattern detected
#> 7 25025010104 -0.333 0.210 no pattern detected
#> 8 25025000703 -0.600 0.0200 no pattern detected
#> 9 25025000504 -0.333 0.210 no pattern detected
#> 10 25025000704 -0.422 0.107 no pattern detected
#> # … with 158 more rows
#> # ℹ Use `print(n = ...)` to see more rows