sadie
performs the SADIE procedure. It computes different indices and
probabilities based on the distance to regularity for the observed spatial
pattern and a specified number of random permutations of this pattern. Both
kind of clustering indices described by Perry et al. (1999) and Li et al.
(2012) can be computed.
sadie(data, ...) # S3 method for data.frame sadie(data, index = c("Perry", "LiMaddenXu", "all"), nperm = 100, seed = NULL, threads = 1, ..., method = "shortsimplex", verbose = TRUE) # S3 method for matrix sadie(data, index = c("Perry", "LiMaddenXu", "all"), nperm = 100, seed = NULL, threads = 1, ..., method = "shortsimplex", verbose = TRUE) # S3 method for count sadie(data, index = c("Perry", "LiMaddenXu", "all"), nperm = 100, seed = NULL, threads = 1, ..., method = "shortsimplex", verbose = TRUE) # S3 method for incidence sadie(data, index = c("Perry", "LiMaddenXu", "all"), nperm = 100, seed = NULL, threads = 1, ..., method = "shortsimplex", verbose = TRUE)
data  A data frame or a matrix with only three columns: the two first
ones must be the x and y coordinates of the sampling units, and the last
one, the corresponding disease intensity observations. It can also be a


...  Additional arguments to be passed to other methods. 
index  The index to be calculated: "Perry", "LiMaddenXu" or "all". By default, only Perry's index is computed for each sampling unit. 
nperm  Number of random permutations to assess probabilities. 
seed  Fixed seed to be used for randomizations (only useful for checking purposes). Not fixed by default (= NULL). 
threads  Number of threads to perform the computations. 
method  Method for the transportation algorithm. 
verbose  Explain what is being done (TRUE by default). 
By convention in the SADIE procedure, clustering indices for a donor unit (outflow) and a receiver unit (inflow) are positive and negative in sign, respectively.
Perry JN. 1995. Spatial analysis by distance indices. Journal of Animal Ecology 64, 303–314. doi:10.2307/5892
Perry JN, Winder L, Holland JM, Alston RD. 1999. Red–blue plots for detecting clusters in count data. Ecology Letters 2, 106–113. doi:10.1046/j.14610248.1999.22057.x
Li B, Madden LV, Xu X. 2012. Spatial analysis by distance indices: an alternative local clustering index for studying spatial patterns. Methods in Ecology and Evolution 3, 368–377. doi:10.1111/j.2041210X.2011.00165.x
set.seed(123) # Create an intensity object: my_count < count(aphids, mapping(x = xm, y = ym)) # Only compute Perry's indices: my_res < sadie(my_count)#> Computation of Perry's indices: #>   0 % ~calculating +  1 % ~57s +  2 % ~29s ++  3 % ~19s ++  4 % ~15s +++  5 % ~12s +++  6 % ~10s ++++  7 % ~08s ++++  8 % ~07s +++++  9 % ~06s +++++  10% ~06s ++++++  11% ~05s ++++++  12% ~05s +++++++  13% ~04s +++++++  14% ~04s ++++++++  15% ~04s ++++++++  16% ~04s +++++++++  17% ~03s +++++++++  18% ~03s ++++++++++  19% ~03s ++++++++++  20% ~03s +++++++++++  21% ~03s +++++++++++  22% ~03s ++++++++++++  23% ~02s ++++++++++++  24% ~02s +++++++++++++  25% ~02s +++++++++++++  26% ~02s ++++++++++++++  27% ~02s ++++++++++++++  28% ~02s +++++++++++++++  29% ~02s +++++++++++++++  30% ~02s ++++++++++++++++  31% ~02s ++++++++++++++++  32% ~02s +++++++++++++++++  33% ~02s +++++++++++++++++  34% ~02s ++++++++++++++++++  35% ~02s ++++++++++++++++++  36% ~01s +++++++++++++++++++  37% ~01s +++++++++++++++++++  38% ~01s ++++++++++++++++++++  39% ~01s ++++++++++++++++++++  40% ~01s +++++++++++++++++++++  41% ~01s +++++++++++++++++++++  42% ~01s ++++++++++++++++++++++  43% ~01s ++++++++++++++++++++++  44% ~01s +++++++++++++++++++++++  45% ~01s +++++++++++++++++++++++  46% ~01s ++++++++++++++++++++++++  47% ~01s ++++++++++++++++++++++++  48% ~01s +++++++++++++++++++++++++  49% ~01s +++++++++++++++++++++++++  50% ~01s ++++++++++++++++++++++++++  51% ~01s ++++++++++++++++++++++++++  52% ~01s +++++++++++++++++++++++++++  53% ~01s +++++++++++++++++++++++++++  54% ~01s ++++++++++++++++++++++++++++  55% ~01s ++++++++++++++++++++++++++++  56% ~01s +++++++++++++++++++++++++++++  57% ~01s +++++++++++++++++++++++++++++  58% ~01s ++++++++++++++++++++++++++++++  59% ~01s ++++++++++++++++++++++++++++++  60% ~01s +++++++++++++++++++++++++++++++  61% ~01s +++++++++++++++++++++++++++++++  62% ~01s ++++++++++++++++++++++++++++++++  63% ~01s ++++++++++++++++++++++++++++++++  64% ~01s +++++++++++++++++++++++++++++++++  65% ~01s +++++++++++++++++++++++++++++++++  66% ~01s ++++++++++++++++++++++++++++++++++  67% ~01s ++++++++++++++++++++++++++++++++++  68% ~01s +++++++++++++++++++++++++++++++++++  69% ~00s +++++++++++++++++++++++++++++++++++  70% ~00s ++++++++++++++++++++++++++++++++++++  71% ~00s ++++++++++++++++++++++++++++++++++++  72% ~00s +++++++++++++++++++++++++++++++++++++  73% ~00s +++++++++++++++++++++++++++++++++++++  74% ~00s ++++++++++++++++++++++++++++++++++++++  75% ~00s ++++++++++++++++++++++++++++++++++++++  76% ~00s +++++++++++++++++++++++++++++++++++++++  77% ~00s +++++++++++++++++++++++++++++++++++++++  78% ~00s ++++++++++++++++++++++++++++++++++++++++  79% ~00s ++++++++++++++++++++++++++++++++++++++++  80% ~00s +++++++++++++++++++++++++++++++++++++++++  81% ~00s +++++++++++++++++++++++++++++++++++++++++  82% ~00s ++++++++++++++++++++++++++++++++++++++++++  83% ~00s ++++++++++++++++++++++++++++++++++++++++++  84% ~00s +++++++++++++++++++++++++++++++++++++++++++  85% ~00s +++++++++++++++++++++++++++++++++++++++++++  86% ~00s ++++++++++++++++++++++++++++++++++++++++++++  87% ~00s ++++++++++++++++++++++++++++++++++++++++++++  88% ~00s +++++++++++++++++++++++++++++++++++++++++++++  89% ~00s +++++++++++++++++++++++++++++++++++++++++++++  90% ~00s ++++++++++++++++++++++++++++++++++++++++++++++  91% ~00s ++++++++++++++++++++++++++++++++++++++++++++++  92% ~00s +++++++++++++++++++++++++++++++++++++++++++++++  93% ~00s +++++++++++++++++++++++++++++++++++++++++++++++  94% ~00s ++++++++++++++++++++++++++++++++++++++++++++++++  95% ~00s ++++++++++++++++++++++++++++++++++++++++++++++++  96% ~00s +++++++++++++++++++++++++++++++++++++++++++++++++  97% ~00s +++++++++++++++++++++++++++++++++++++++++++++++++  98% ~00s ++++++++++++++++++++++++++++++++++++++++++++++++++ 99% ~00s ++++++++++++++++++++++++++++++++++++++++++++++++++ 100% elapsed = 01smy_res#> Spatial Analysis by Distance IndicEs (sadie) #> #> Call: #> sadie.count(data = my_count) #> #> Ia: 1.3168 (Pa = 0.03) #>summary(my_res)#> #> Call: #> sadie.count(data = my_count) #> #> First 6 rows of clustering indices: #> x y i cost_flows idx_P idx_LMX prob #> 1 0 0 0 148.09143 2.0168809 NA NA #> 2 30 0 0 91.27588 1.2831301 NA NA #> 3 60 0 3 108.16654 2.0451766 NA NA #> 4 90 0 7 40.99682 0.6900056 NA NA #> 5 120 0 9 30.00000 0.8723695 NA NA #> 6 150 0 1 42.31033 0.7050747 NA NA #> #> Summary indices: #> overall inflow outflow #> Perry's index 1.321625 1.396555 1.221604 #> LiMaddenXu's index NA NA NA #> #> Main outputs: #> Ia: 1.3168 (Pa = 0.03) #> #> 'Total cost': 1061.153 #> Number of permutations: 100 #>plot(my_res)plot(my_res, isoclines = TRUE)set.seed(123) # Compute both Perry's and LiMaddenXu's indices (using multithreading): my_res < sadie(my_count, index = "all", threads = 2, nperm = 20)#> Computation of Perry's indices: #>   0 % ~calculating +++++  10% ~00s ++++++++++  20% ~00s +++++++++++++++  30% ~00s ++++++++++++++++++++  40% ~00s +++++++++++++++++++++++++  50% ~00s ++++++++++++++++++++++++++++++  60% ~00s +++++++++++++++++++++++++++++++++++  70% ~00s ++++++++++++++++++++++++++++++++++++++++  80% ~00s +++++++++++++++++++++++++++++++++++++++++++++  90% ~00s ++++++++++++++++++++++++++++++++++++++++++++++++++ 100% elapsed = 00s #> Computation of LiMaddenXu's indices: #>   0 % ~calculating +++++  10% ~02s ++++++++++  20% ~01s +++++++++++++++  30% ~01s ++++++++++++++++++++  40% ~01s +++++++++++++++++++++++++  50% ~01s ++++++++++++++++++++++++++++++  60% ~01s +++++++++++++++++++++++++++++++++++  70% ~01s ++++++++++++++++++++++++++++++++++++++++  80% ~00s +++++++++++++++++++++++++++++++++++++++++++++  90% ~00s ++++++++++++++++++++++++++++++++++++++++++++++++++ 100% elapsed = 02smy_res#> Spatial Analysis by Distance IndicEs (sadie) #> #> Call: #> sadie.count(data = my_count, index = "all", nperm = 20, threads = 2) #> #> Ia: 1.3460 (Pa = < 2.22e16) #>summary(my_res)#> #> Call: #> sadie.count(data = my_count, index = "all", nperm = 20, threads = 2) #> #> First 6 rows of clustering indices: #> x y i cost_flows idx_P idx_LMX prob #> 1 0 0 0 148.09143 2.0876266 2.3518152 0.0952381 #> 2 30 0 0 91.27588 1.5937590 1.5172813 0.2857143 #> 3 60 0 3 108.16654 1.9714669 1.7362210 0.1904762 #> 4 90 0 7 40.99682 0.7708789 1.1704367 0.4285714 #> 5 120 0 9 30.00000 0.9748595 0.8968911 0.2380952 #> 6 150 0 1 42.31033 0.6676054 0.6573582 0.6190476 #> #> Summary indices: #> overall inflow outflow #> Perry's index 1.330535 1.381741 1.284674 #> LiMaddenXu's index 1.301196 1.369976 1.214019 #> #> Main outputs: #> Ia: 1.3460 (Pa = < 2.22e16) #> #> 'Total cost': 1061.153 #> Number of permutations: 20 #>plot(my_res) # Identical to: plot(my_res, index = "Perry")plot(my_res, index = "LiMaddenXu")set.seed(123) # Using usual data frames instead of intensity objects: my_df < aphids[, c("xm", "ym", "i")] sadie(my_df)#> Computation of Perry's indices: #>   0 % ~calculating +  1 % ~01s +  2 % ~01s ++  3 % ~01s ++  4 % ~01s +++  5 % ~01s +++  6 % ~07s ++++  7 % ~09s ++++  8 % ~08s +++++  9 % ~07s +++++  10% ~07s ++++++  11% ~06s ++++++  12% ~05s +++++++  13% ~05s +++++++  14% ~05s ++++++++  15% ~04s ++++++++  16% ~04s +++++++++  17% ~04s +++++++++  18% ~04s ++++++++++  19% ~03s ++++++++++  20% ~03s +++++++++++  21% ~03s +++++++++++  22% ~03s ++++++++++++  23% ~03s ++++++++++++  24% ~03s +++++++++++++  25% ~02s +++++++++++++  26% ~02s ++++++++++++++  27% ~02s ++++++++++++++  28% ~02s +++++++++++++++  29% ~02s +++++++++++++++  30% ~02s ++++++++++++++++  31% ~02s ++++++++++++++++  32% ~02s +++++++++++++++++  33% ~02s +++++++++++++++++  34% ~02s ++++++++++++++++++  35% ~02s ++++++++++++++++++  36% ~02s +++++++++++++++++++  37% ~02s +++++++++++++++++++  38% ~01s ++++++++++++++++++++  39% ~01s ++++++++++++++++++++  40% ~01s +++++++++++++++++++++  41% ~01s +++++++++++++++++++++  42% ~01s ++++++++++++++++++++++  43% ~01s ++++++++++++++++++++++  44% ~01s +++++++++++++++++++++++  45% ~01s +++++++++++++++++++++++  46% ~01s ++++++++++++++++++++++++  47% ~01s ++++++++++++++++++++++++  48% ~01s +++++++++++++++++++++++++  49% ~01s +++++++++++++++++++++++++  50% ~01s ++++++++++++++++++++++++++  51% ~01s ++++++++++++++++++++++++++  52% ~01s +++++++++++++++++++++++++++  53% ~01s +++++++++++++++++++++++++++  54% ~01s ++++++++++++++++++++++++++++  55% ~01s ++++++++++++++++++++++++++++  56% ~01s +++++++++++++++++++++++++++++  57% ~01s +++++++++++++++++++++++++++++  58% ~01s ++++++++++++++++++++++++++++++  59% ~01s ++++++++++++++++++++++++++++++  60% ~01s +++++++++++++++++++++++++++++++  61% ~01s +++++++++++++++++++++++++++++++  62% ~01s ++++++++++++++++++++++++++++++++  63% ~01s ++++++++++++++++++++++++++++++++  64% ~01s +++++++++++++++++++++++++++++++++  65% ~01s +++++++++++++++++++++++++++++++++  66% ~01s ++++++++++++++++++++++++++++++++++  67% ~01s ++++++++++++++++++++++++++++++++++  68% ~01s +++++++++++++++++++++++++++++++++++  69% ~01s +++++++++++++++++++++++++++++++++++  70% ~00s ++++++++++++++++++++++++++++++++++++  71% ~00s ++++++++++++++++++++++++++++++++++++  72% ~00s +++++++++++++++++++++++++++++++++++++  73% ~00s +++++++++++++++++++++++++++++++++++++  74% ~00s ++++++++++++++++++++++++++++++++++++++  75% ~00s ++++++++++++++++++++++++++++++++++++++  76% ~00s +++++++++++++++++++++++++++++++++++++++  77% ~00s +++++++++++++++++++++++++++++++++++++++  78% ~00s ++++++++++++++++++++++++++++++++++++++++  79% ~00s ++++++++++++++++++++++++++++++++++++++++  80% ~00s +++++++++++++++++++++++++++++++++++++++++  81% ~00s +++++++++++++++++++++++++++++++++++++++++  82% ~00s ++++++++++++++++++++++++++++++++++++++++++  83% ~00s ++++++++++++++++++++++++++++++++++++++++++  84% ~00s +++++++++++++++++++++++++++++++++++++++++++  85% ~00s +++++++++++++++++++++++++++++++++++++++++++  86% ~00s ++++++++++++++++++++++++++++++++++++++++++++  87% ~00s ++++++++++++++++++++++++++++++++++++++++++++  88% ~00s +++++++++++++++++++++++++++++++++++++++++++++  89% ~00s +++++++++++++++++++++++++++++++++++++++++++++  90% ~00s ++++++++++++++++++++++++++++++++++++++++++++++  91% ~00s ++++++++++++++++++++++++++++++++++++++++++++++  92% ~00s +++++++++++++++++++++++++++++++++++++++++++++++  93% ~00s +++++++++++++++++++++++++++++++++++++++++++++++  94% ~00s ++++++++++++++++++++++++++++++++++++++++++++++++  95% ~00s ++++++++++++++++++++++++++++++++++++++++++++++++  96% ~00s +++++++++++++++++++++++++++++++++++++++++++++++++  97% ~00s +++++++++++++++++++++++++++++++++++++++++++++++++  98% ~00s ++++++++++++++++++++++++++++++++++++++++++++++++++ 99% ~00s ++++++++++++++++++++++++++++++++++++++++++++++++++ 100% elapsed = 01s#> Spatial Analysis by Distance IndicEs (sadie) #> #> Call: #> sadie.data.frame(data = my_df) #> #> Ia: 1.3168 (Pa = 0.03) #>