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.28628232 two-sided   0.92
#> 2                 Silt / Lfp    r -0.076256133 -1.01126869 two-sided   0.36
#> 3                 Sand / Lfp    r  0.063614861  0.95312359 two-sided    0.3
#> 4                  K2O / Lfp    r  0.031979355  0.59543886 two-sided   0.68
#> 5                 Mg++ / Lfp    r  0.014982765  0.27223776 two-sided   0.82
#> 6             Na+/100g / Lfp    r  0.093499930  1.46091783 two-sided   0.16
#> 7                   K+ / Lfp    r  0.149968927  1.60826318 two-sided   0.08
#> 8         Conductivity / Lfp    r  0.080497038  1.17099943 two-sided   0.26
#> 9            Retention / Lfp    r -0.067943687 -1.09977856 two-sided   0.22
#> 10               Na+/l / Lfp    r  0.063272819  0.96402509 two-sided   0.38
#> 11           Elevation / Lfp    r -0.129537428 -1.55418861 two-sided   0.16
#> 12         Clay / Min height    r  0.061180871  1.25806689 two-sided   0.24
#> 13         Silt / Min height    r -0.052382325 -1.37403159 two-sided   0.16
#> 14         Sand / Min height    r -0.027907397 -0.37074930 two-sided    0.7
#> 15          K2O / Min height    r  0.047550545  0.92900312 two-sided   0.46
#> 16         Mg++ / Min height    r -0.023023055 -0.35915803 two-sided   0.78
#> 17     Na+/100g / Min height    r  0.027191299  0.52191112 two-sided   0.62
#> 18           K+ / Min height    r  0.095029793  1.78304988 two-sided    0.1
#> 19 Conductivity / Min height    r -0.018899856 -0.36432840 two-sided   0.74
#> 20    Retention / Min height    r  0.004165428  0.02054957 two-sided      1
#> 21        Na+/l / Min height    r -0.046119268 -0.86080307 two-sided   0.42
#> 22    Elevation / Min height    r  0.061211127  1.20666627 two-sided   0.28
#> 23         Clay / Max height    r  0.010762151  0.17255834 two-sided   0.92
#> 24         Silt / Max height    r -0.030835126 -0.49157475 two-sided   0.62
#> 25         Sand / Max height    r  0.027229507  0.56173926 two-sided    0.6
#> 26          K2O / Max height    r  0.063923177  1.03919124 two-sided    0.3
#> 27         Mg++ / Max height    r  0.010886210  0.41255263 two-sided   0.78
#> 28     Na+/100g / Max height    r  0.026525395  0.52614962 two-sided   0.62
#> 29           K+ / Max height    r  0.109401849  1.37107725 two-sided   0.18
#> 30 Conductivity / Max height    r  0.002446542  0.03308545 two-sided      1
#> 31    Retention / Max height    r -0.005456736 -0.15142262 two-sided   0.98
#> 32        Na+/l / Max height    r -0.018577793 -0.42393716 two-sided   0.76
#> 33    Elevation / Max height    r  0.033495574  0.85049621 two-sided   0.42
#>    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