This function allows to test fourth-corner statistics using constrained null models (for traits and/or environmental variables). If the argument phyloORorthobasis is specified, random traits are phylogenetically-constrained to preserve the global autocorrelation (Moran's I) and the phylogenetic structures at multiple scales. If not, standard permutations are used. If the argument listwORorthobasis is specified, random environmental variables are spatially-constrained to preserve the global autocorrelation (Moran's I) and the spatial structures at multiple scales. If not, standard permutations are used. 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 '`4thcorner`'
msr(
  x,
  listwORorthobasis,
  phyloORorthobasis,
  nrepet = x$npermut,
  method = c("pair", "triplet", "singleton"),
  ...
)

Arguments

x

An object generated by the fourthcorner function.

listwORorthobasis

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

phyloORorthobasis

an object of the class phylo (phylogeny) created by the functions of the ape package or an object of class orthobasis generated by functions of adephylo (me.phylo)

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 4thcorner randomized replicates.

References

Braga, J., Thuiller, W., ter Braak, C.J.F. and Dray, S. (2018) Integrating spatial and phylogenetic information in the fourth-corner analysis to test trait-environment relationships. Ecology, 99:2667-2674.

See also

Author

Stephane Dray stephane.dray@univ-lyon1.fr

Examples


if(require("ade4", quietly = TRUE) & require("adephylo", quietly = TRUE)
& require("spdep", quietly = TRUE) & require("ape", quietly = TRUE)){
data(mafragh, package = "ade4")
fr1 <- fourthcorner(mafragh$env, mafragh$flo, mafragh$traits$tabQuantitative, nrepet = 49)
phy <- read.tree(text = mafragh$tre)
lw <- nb2listw(mafragh$nb)
fr1.msr <- msr(fr1, listwORorthobasis = lw, phyloORorthobasis = phy)

fr1
fr1.msr
}
#> 
#> Attaching package: ‘ape’
#> The following object is masked from ‘package:adegraphics’:
#> 
#>     zoom
#> Fourth-corner Statistics
#> ------------------------
#> Permutation method  msr  ( 49  permutations)
#> 
#> Adjustment method for multiple comparisons:   holm 
#> call:  msr.4thcorner(x = fr1, listwORorthobasis = lw, phyloORorthobasis = phy) 
#> 
#> ---
#> 
#>                         Test Stat          Obs     Std.Obs     Alter Pvalue
#> 1                 Clay / Lfp    r  0.014241856  0.31344983 two-sided    0.8
#> 2                 Silt / Lfp    r -0.076256133 -1.04348067 two-sided   0.38
#> 3                 Sand / Lfp    r  0.063614861  0.83723555 two-sided    0.4
#> 4                  K2O / Lfp    r  0.031979355  0.55194697 two-sided   0.78
#> 5                 Mg++ / Lfp    r  0.014982765  0.30489925 two-sided   0.86
#> 6             Na+/100g / Lfp    r  0.093499930  1.58354671 two-sided   0.14
#> 7                   K+ / Lfp    r  0.149968927  1.66354996 two-sided   0.04
#> 8         Conductivity / Lfp    r  0.080497038  1.39839433 two-sided   0.18
#> 9            Retention / Lfp    r -0.067943687 -0.78196411 two-sided    0.5
#> 10               Na+/l / Lfp    r  0.063272819  1.23379224 two-sided    0.2
#> 11           Elevation / Lfp    r -0.129537428 -1.42118199 two-sided    0.2
#> 12         Clay / Min height    r  0.061180871  1.24718751 two-sided    0.2
#> 13         Silt / Min height    r -0.052382325 -0.97141557 two-sided   0.36
#> 14         Sand / Min height    r -0.027907397 -0.70638146 two-sided   0.46
#> 15          K2O / Min height    r  0.047550545  0.86529722 two-sided   0.44
#> 16         Mg++ / Min height    r -0.023023055 -0.21889128 two-sided   0.96
#> 17     Na+/100g / Min height    r  0.027191299  0.68785365 two-sided    0.5
#> 18           K+ / Min height    r  0.095029793  1.75996060 two-sided   0.06
#> 19 Conductivity / Min height    r -0.018899856 -0.27560449 two-sided    0.8
#> 20    Retention / Min height    r  0.004165428  0.15953651 two-sided   0.96
#> 21        Na+/l / Min height    r -0.046119268 -0.77623227 two-sided   0.46
#> 22    Elevation / Min height    r  0.061211127  0.75806348 two-sided   0.38
#> 23         Clay / Max height    r  0.010762151  0.21379340 two-sided   0.82
#> 24         Silt / Max height    r -0.030835126 -0.45487793 two-sided   0.72
#> 25         Sand / Max height    r  0.027229507  0.47114234 two-sided   0.58
#> 26          K2O / Max height    r  0.063923177  1.21898682 two-sided   0.24
#> 27         Mg++ / Max height    r  0.010886210  0.25253410 two-sided   0.78
#> 28     Na+/100g / Max height    r  0.026525395  0.63579493 two-sided   0.48
#> 29           K+ / Max height    r  0.109401849  1.49608195 two-sided   0.18
#> 30 Conductivity / Max height    r  0.002446542  0.04059237 two-sided   0.98
#> 31    Retention / Max height    r -0.005456736  0.06726077 two-sided   0.98
#> 32        Na+/l / Max height    r -0.018577793 -0.47742690 two-sided   0.68
#> 33    Elevation / Max height    r  0.033495574  0.58742707 two-sided   0.56
#>    Pvalue.adj  
#> 1           1  
#> 2           1  
#> 3           1  
#> 4           1  
#> 5           1  
#> 6           1  
#> 7           1  
#> 8           1  
#> 9           1  
#> 10          1  
#> 11          1  
#> 12          1  
#> 13          1  
#> 14          1  
#> 15          1  
#> 16          1  
#> 17          1  
#> 18          1  
#> 19          1  
#> 20          1  
#> 21          1  
#> 22          1  
#> 23          1  
#> 24          1  
#> 25          1  
#> 26          1  
#> 27          1  
#> 28          1  
#> 29          1  
#> 30          1  
#> 31          1  
#> 32          1  
#> 33          1  
#> 
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1