envfit_cwm: Fits community weighted mean of species attributes (CWM) onto...

Description Usage Arguments Details

Description

The function fits community weighted mean of species attributes (e.g. traits), calculated for individual samples, onto an ordination, using multiple regression. The relationship is tested by permutation test (defaults to modified permutation test sensu Zeleny & Schaffers 2012).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
envfit_cwm(
  ord,
  cwm,
  wstand = attr(cwm, "wstand"),
  permutations = 999,
  choices = c(1, 2),
  display = "sites",
  w = weights(ord, display),
  na.rm = FALSE,
  test = "modified",
  adjustP = FALSE,
  p.adjust.method = "holm",
  p.adjust.n = NULL,
  ...
)

Arguments

ord

An ordination object or other structure from which the ordination scores can be extracted (including a data frame or matrix of scores).

cwm

Community weighted means calculated by function cwm; object of the class cwm.

wstand

Logical; should be the cwm calculated on weighted standardized species attributes? Defaults to the same setting as used in cwm function (FALSE).

permutations

Number of permutations for the permutation test.

choices

Axes to be plotted.

display

In fitting functions these are ordinary site scores or linear combination scores ("lc") in constrained ordination (cca, rda, capscale). In scores function they are either "vectors" or "factors" (with synonyms "bp" or "cn", resp.). (Description from vegan::envfit help file).

w

Weights used in fitting (concerns mainly cca and decorana results which have nonconstant weights). (Description from vegan::envfit help file).

na.rm

Remove rows in ordination scores or cwm variables with missing values - the whole row of data in both ordination and cwm is removed in case of any missing values and na.rm = TRUE.

test

Permutation test.

adjustP

Logical; should the P-values be adjusted for multiple testing?

p.adjust.method

Character string; method of P-value adjustement (check p.adjust.methods for available option, default 'holm').

p.adjust.n

Integer; what is the number of comparisons used to adjust the P-values? Default (p.adjust.n = NULL) means that the number equals to the number of conducted tests (= number of cwm variables).

...

Parameters passed to scores.

Details

The function is derived from the function envfit in library (vegan), which fits the environmental vectors or factors onto an ordination and tests their significance using permutation test. The modification is in the permutation schema used to test the fit significance: while the original vegan::envfit function builds the null distribution of test statistic (r2) by permuting the values of environmental vector (analogy of standard or rowbased test), the function weimea::envfit_cwm additionally offers also modified or rowbased test, based on permuting species attributes prior to calculation of cwm, and max test combining results of rowbased and colbased as P_max = max (P_row, P_col). While the null hypothesis of standard (rowbased) permutation test that there is "no statistical relationship between mean indicator values and sample ordination scores" is easy to reject in case that CWM's are numerically derived from the same species composition matrix as sample ordination scores (this applies even if some kind of transformation, e.g. log or presence-absence, was applied on the species data before calculating either ordination or CWM), since such relationship is spurious. The null hypothesis of the alternative modified (rowbased) permutation test is that there is "no statistical relationship between information in species attributes and sample ordination scores", which is not spurious if species attributes (traits) are extrinsic to species composition (i.e. not numerically derived from it). The third, max test, combines these two results together, and is probably not meaningful in the context of relating CWM of species attributes and sample ordination scores, because it includes the standard (rowbased) test which has no meaningful null hypothesis (as explained above).

The permutation test requires information about the original vegetation matrix used to calculate the weighted mean of species indicator values, and also original species attributes, which is stored in the object of cwm class as 'com' and 'traits' attributes. If the argument cwm is not the object of cwm class, the function will calculate standard vegan::envfit and return warning message.

The generic functions print, plot and scores for the class envfit can be used to print the results, plot the vectors of CWM onto an ordination diagram and to return the fitting results. Check ?envfit for details which arguments can be used in these functions.


zdealveindy/weimea documentation built on Sept. 21, 2021, 2:15 p.m.