Description Usage Arguments Details Value See Also Examples
Function calculating relationship between weighted-mean of species attributes and sample attributes and performing standard (row based), modified (column based), or max test of significance.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | test_cwm(
cwm,
env,
method = c("cor"),
wcor = FALSE,
wstand = FALSE,
wreg = FALSE,
wsamp = NULL,
dependence = "cwm ~ env",
perm = 499,
test = "max",
parallel = NULL,
p.adjust.method = "holm",
adjustP = FALSE
)
## S3 method for class 'testCWM'
print(
x,
digits = max(3, getOption("digits") - 3),
missing.summary = FALSE,
eps.Pvalue = 0.001,
signif.stars = getOption("show.signif.stars"),
...
)
## S3 method for class 'testCWM'
coef(object, ...)
## S3 method for class 'testCWM'
plot(
x,
alpha = 0.05,
line = NA,
cex.lab = 1.5,
par.mar = c(0.5, 0.5, 0.5, 0.5),
box.col = c("blue", "red"),
box.lwd = 2,
...
)
|
cwm |
An object of the class |
env |
Vector or matrix with variables. See details. |
method |
Statistical method used to analyse the relationship between cwm (of class |
wcor |
Logical; should the correlation be weighted by rowsums of |
wstand |
Logical; should the variables in correlation be first weighted-standardized? Default |
wreg |
Logical; should weights be used in the regression ( |
wsamp |
Either |
dependence |
Should |
perm |
Number of permutations. |
test |
Vector of character values. Which test should be conducted? Partial match to |
parallel |
NULL (default) or integer number. Number of cores for parallel calculation of modified permutation test. Maximum number of cores should correspond to number of available cores on the processor. |
p.adjust.method |
A string indicating the method of P-value adjustement, see |
adjustP |
Logical, default FALSE. Should be the P-values adjusted? If |
x, object |
object of the class |
digits |
number of digits reported by |
missing.summary |
Logical; should be the summary of values missing in |
eps.Pvalue |
Values of P below this threshold will be printed as |
signif.stars |
Logical; if TRUE, P-values are additionally encoded visually as 'significance stars' in order to help scanning of long coefficient tables. It defaults to the show.signif.stars slot of |
... |
Other arguments for |
alpha, line, cex.lab, par.mar, box.col, box.lwd |
Graphical parameters for |
Currently implemented statistical methods: 'cor'
, 'lm'
and 'aov'
. For fourth corner use test_fourth
.
Argument env
can be vector or matrix with one column. Only in the case of linear regression (method = 'lm'
) it is possible to use matrix with several variables, which will all be used as independent variables in the model. For ANOVA and Kruskal-Wallis test, make sure that 'env' is factor
(warning will be returned if this is not the case, but the calculation will be conducted).
Specific issue related to weighted mean is the case of missing species attributes. In current implementation, species with missing species attributes are removed from sample x species matrix prior to permutation of species attributes among species.
The plot
functions will plot pairwise relationships between CWM and environmental variables, as a scatterplots in case of method = 'cor'
and 'lm'
and as boxplot in case of method = 'aov'
. Significant relationships are highlighted in the figure by colorful border; the P-values used for this highlighting are the last one listed in the summary output. If you don't like this behaviour, limit the analysis to a single test only - in that case this test will be used to highlight the significant results.
Function cwm
returns list of the class "cwm"
(with print
and summary
methods), which contains the following components:
call
Call to the function.
out
Matrix with analysis results (coefficients, statistics, P-values).
miss
Matrix with counts of missing values in env
, cwm
and traits
.
param
List with the setting of the function parameters (arguments).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | data (vltava)
# Traits vs environment (tested by max test)
CWM_traits <- cwm (com = vltava$herbs$spe, traits = vltava$herbs$traits)
re_traits <- test_cwm (cwm = CWM_traits, env = vltava$env[,c('pH', 'COVERE32')],
method = 'lm', adjustP = TRUE)
re_traits
plot (re_traits)
# Ellenberg indicator values vs assignment of plots into groups (by cluster analysis)
# (tested by modified (column-based) permutation test)
CWM_ell <- cwm (com = vltava$spe, traits = vltava$civ[,1:5])
re_ell <- test_cwm (cwm = CWM_ell, env = as.factor (vltava$env$GROUP), test = 'modif',
method = 'aov', adjustP = TRUE)
re_ell
plot (re_ell)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.