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).
An object generated by the fourthcorner
function.
an object of the class listw
(spatial
weights) created by the functions of the spdep package or an object
of class orthobasis
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
)
an integer
indicating the number of replicates
an character specifying which algorithm should be used to
produce spatial replicates (see msr.default
).
further arguments of the msr.default
function.
An object of class 4thcorner
randomized replicates.
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.
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.31579299 two-sided 0.82
#> 2 Silt / Lfp r -0.076256133 -1.04239897 two-sided 0.38
#> 3 Sand / Lfp r 0.063614861 0.88300763 two-sided 0.34
#> 4 K2O / Lfp r 0.031979355 0.55144794 two-sided 0.8
#> 5 Mg++ / Lfp r 0.014982765 0.29893784 two-sided 0.88
#> 6 Na+/100g / Lfp r 0.093499930 1.59338097 two-sided 0.14
#> 7 K+ / Lfp r 0.149968927 1.66026056 two-sided 0.04
#> 8 Conductivity / Lfp r 0.080497038 1.40530605 two-sided 0.18
#> 9 Retention / Lfp r -0.067943687 -0.82832091 two-sided 0.48
#> 10 Na+/l / Lfp r 0.063272819 1.24043651 two-sided 0.18
#> 11 Elevation / Lfp r -0.129537428 -1.40835856 two-sided 0.2
#> 12 Clay / Min height r 0.061180871 1.13931658 two-sided 0.22
#> 13 Silt / Min height r -0.052382325 -0.92958610 two-sided 0.42
#> 14 Sand / Min height r -0.027907397 -0.65455940 two-sided 0.5
#> 15 K2O / Min height r 0.047550545 0.85017666 two-sided 0.48
#> 16 Mg++ / Min height r -0.023023055 -0.30360580 two-sided 0.88
#> 17 Na+/100g / Min height r 0.027191299 0.71276591 two-sided 0.48
#> 18 K+ / Min height r 0.095029793 1.83064267 two-sided 0.08
#> 19 Conductivity / Min height r -0.018899856 -0.28926894 two-sided 0.74
#> 20 Retention / Min height r 0.004165428 0.14846309 two-sided 0.88
#> 21 Na+/l / Min height r -0.046119268 -0.78494573 two-sided 0.44
#> 22 Elevation / Min height r 0.061211127 0.71165299 two-sided 0.38
#> 23 Clay / Max height r 0.010762151 0.19692108 two-sided 0.86
#> 24 Silt / Max height r -0.030835126 -0.44458505 two-sided 0.62
#> 25 Sand / Max height r 0.027229507 0.50640313 two-sided 0.54
#> 26 K2O / Max height r 0.063923177 1.20469667 two-sided 0.24
#> 27 Mg++ / Max height r 0.010886210 0.20388054 two-sided 0.82
#> 28 Na+/100g / Max height r 0.026525395 0.64869574 two-sided 0.52
#> 29 K+ / Max height r 0.109401849 1.56157607 two-sided 0.12
#> 30 Conductivity / Max height r 0.002446542 0.02121027 two-sided 0.98
#> 31 Retention / Max height r -0.005456736 0.04568992 two-sided 1
#> 32 Na+/l / Max height r -0.018577793 -0.47181087 two-sided 0.68
#> 33 Elevation / Max height r 0.033495574 0.55874637 two-sided 0.58
#> 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