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 | test_cwm(cwm, env, method = c("cor"), wcor = FALSE, wstand = FALSE,
wreg = 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, adjustP = FALSE, ...)
## S3 method for class 'testCWM'
coef(object, ...)
## S3 method for class 'testCWM'
plot(x, alpha = 0.05, line = 2.5, cex.lab = 1.5,
par.mar = c(4, 4, 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 |
|
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 |
... |
Other arguments for |
alpha, line, cex.lab, par.mar, box.col, box.lwd |
Graphical parameters for |
Currently implemented statistical methods: 'cor'
. Plan to implement also: 'lm'
and 'aov'
. For fourth corner, please 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).
Difference between method = 'lm'
and 'aov'
is in the format of summary tables, returned by summary.cwm
function. In case of 'aov', this summary is expressed in the traditional language of ANOVA rather than linear models.
Both method = 'lm'
and 'slope'
are based on linear regression and calculated by function lm
, but differ by test statistic: while 'lm' is using F value and is testing the strength of the regression (measured by r2), 'slope' is using the slope of the regression line (b). This statistic is added here for comparison with the fourth corner method.
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.
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 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.