test_contrasts: Test (multiple) univariate contrasts

Description Usage Arguments Value Note Author(s)

View source: R/test_contrasts.R

Description

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.

Usage

1
2
test_contrasts(W, specdata, vars, parametric = T, plotit = T,
  method = "bonferroni")

Arguments

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 specdata.

parametric

Logical. If TRUE (default), parametric multiple comparisons are performed, otherwise a non-parametric procedure is used.

plotit

Logical. If TRUE, plots 95% confidence intervals of the contrasts. One plot per dependent variable.

method

Correction method for adjusting p-values (parametric procedure).

Value

A list with one element for each dependent variable in vars. Each element is a data frame with columns:

Note

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).

Author(s)

Raphael Scherrer


rscherrer/sagreicolor documentation built on May 26, 2019, 12:32 p.m.