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.02354579 two-sided   0.94
#> 2                 Silt / Lfp    r -0.076256133 -0.88508320 two-sided    0.4
#> 3                 Sand / Lfp    r  0.063614861  1.06487968 two-sided   0.26
#> 4                  K2O / Lfp    r  0.031979355  0.22122125 two-sided    0.9
#> 5                 Mg++ / Lfp    r  0.014982765  0.11196136 two-sided   0.96
#> 6             Na+/100g / Lfp    r  0.093499930  1.07691685 two-sided   0.32
#> 7                   K+ / Lfp    r  0.149968927  1.18174616 two-sided    0.3
#> 8         Conductivity / Lfp    r  0.080497038  0.90064013 two-sided   0.38
#> 9            Retention / Lfp    r -0.067943687 -0.91942181 two-sided   0.42
#> 10               Na+/l / Lfp    r  0.063272819  0.76955442 two-sided   0.42
#> 11           Elevation / Lfp    r -0.129537428 -1.25095435 two-sided   0.24
#> 12         Clay / Min height    r  0.061180871  1.01291381 two-sided    0.4
#> 13         Silt / Min height    r -0.052382325 -0.90909265 two-sided   0.48
#> 14         Sand / Min height    r -0.027907397 -0.46567470 two-sided   0.72
#> 15          K2O / Min height    r  0.047550545  1.06714650 two-sided   0.34
#> 16         Mg++ / Min height    r -0.023023055 -0.55270713 two-sided   0.64
#> 17     Na+/100g / Min height    r  0.027191299  0.41929177 two-sided    0.6
#> 18           K+ / Min height    r  0.095029793  1.67903999 two-sided    0.1
#> 19 Conductivity / Min height    r -0.018899856 -0.57233923 two-sided   0.58
#> 20    Retention / Min height    r  0.004165428  0.11766350 two-sided    0.9
#> 21        Na+/l / Min height    r -0.046119268 -1.18478048 two-sided   0.24
#> 22    Elevation / Min height    r  0.061211127  0.87199828 two-sided   0.42
#> 23         Clay / Max height    r  0.010762151 -0.04489317 two-sided   0.98
#> 24         Silt / Max height    r -0.030835126 -0.32436846 two-sided   0.76
#> 25         Sand / Max height    r  0.027229507  0.65877759 two-sided   0.54
#> 26          K2O / Max height    r  0.063923177  1.29519424 two-sided   0.24
#> 27         Mg++ / Max height    r  0.010886210  0.15925850 two-sided   0.94
#> 28     Na+/100g / Max height    r  0.026525395  0.45085568 two-sided   0.62
#> 29           K+ / Max height    r  0.109401849  1.28292558 two-sided   0.24
#> 30 Conductivity / Max height    r  0.002446542 -0.20283308 two-sided   0.78
#> 31    Retention / Max height    r -0.005456736 -0.03073410 two-sided      1
#> 32        Na+/l / Max height    r -0.018577793 -0.71141329 two-sided   0.52
#> 33    Elevation / Max height    r  0.033495574  0.64796849 two-sided   0.62
#>    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