This function allows to test the Mantel statistic using constrained null models in the presence of spatial autocorrelation. Random replicates of the second distance matrix are produced. They are spatially-constrained to preserve the global autocorrelation (Moran's I) and the spatial structures at multiple scales. Multiscale property is defined by the power spectrum (i.e. decomposition of the variance of the original variables) on a basis of orthonormal eigenvectors (Moran's Eigenvector Maps, MEM).

# S3 method for class 'mantelrtest'
msr(
  x,
  listwORorthobasis,
  nrepet = x$rep,
  method = c("pair", "triplet", "singleton"),
  ...
)

Arguments

x

An object generated by the mantel.randtest function.

listwORorthobasis

an object of the class listw (spatial weights) created by the functions of the spdep package or an object of class orthobasis

nrepet

an integer indicating the number of replicates

method

an character specifying which algorithm should be used to produce spatial replicates (see msr.default).

...

further arguments of the msr.default function.

Value

An object of class randtest.

References

Crabot, J., Clappe, S., Dray, S. and Datry, T. (2019) Testing the Mantel statistic with a spatially-constrained permutation procedure. Methods in Ecology and Evolution. in press.

Author

Sylvie Clappe, Stephane Dray stephane.dray@univ-lyon1.fr

Examples


if(require("ade4", quietly = TRUE)
& require("spdep", quietly = TRUE)){
data(mafragh, package = "ade4")

d1 <- dist(mafragh$env[,1:3])
d2 <- dist(mafragh$env[,7])
t1 <- mantel.randtest(d1,d2)
t1

lw <- nb2listw(mafragh$nb)
t2 <- msr(t1, listwORorthobasis = lw)
t2

}
#> Warning: Zero distance(s)
#> Warning: Zero distance(s)
#> Monte-Carlo test
#> Call: msr.mantelrtest(x = t1, listwORorthobasis = lw)
#> 
#> Observation: 0.1197583 
#> 
#> Based on 999 replicates
#> Simulated p-value: 0.205 
#> Alternative hypothesis: greater 
#> 
#>     Std.Obs Expectation    Variance 
#> 0.820956883 0.045009996 0.008290148