Description Usage Arguments Value Note Author(s)
View source: R/test_contrasts.R
This function tests for significant contrasts between habitat-means within islands in one or several dependent variables independently. The procedure is either parametric (package multcomp) or non-parametric (package nparcomp). The function can also plot the 95% confidence intervals of the differences in means.
1 2 | test_contrasts(W, specdata, vars, parametric = T, plotit = T,
method = "bonferroni")
|
W |
A matrix indicating all contrasts to be tested, or a vector if only one contrast. The number of rows is the number of contrasts to test. The number of columns is the number of groups. The matrix/vector is filled with zeros, except for a 1 and a -1 at the position of the groups that are to be contrasted. |
specdata |
A data frame containing at least columns for the dependent variables, as well as a column "island" and a column "habitat". |
vars |
A character or integer vector. The names, or indices, of the dependent variables in |
parametric |
Logical. If |
plotit |
Logical. If |
method |
Correction method for adjusting p-values (parametric procedure). |
A list with one element for each dependent variable in vars
. Each element is a data frame with columns:
Parametric workflow as per Salvatore S. Mangiafico (https://rcompanion.org/rcompanion/h_01.html). Non-parametric workflow from the package description of nparcomp. Note also that performing multiple comparisons one dependent variable at a time is not so bad if variables have limited correlation, as in the case of principal components (Krishnaiah and Reising 2006).
Raphael Scherrer
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.