Description Usage Arguments Details Value Author(s) References Examples

This function implements pairwise comparisons for categorical variable through `capscale`

, `cca`

, `dbrda`

or `rda`

followed by `anova.cca`

. The function simply repeats constrained ordination analysis by selecting subsets of data that correspond to two factor levels.

1 2 |

`method` |
Method for constrained ordination analysis; one of "rda", "cca", "dbrda" or "capscale". |

`formula` |
Model formula as in |

`data` |
Data frame containing the variables on the right hand side of the model formula as in |

`distance` |
Dissimilarity (or distance) index in vegdist used if the LHS of the formula is a data frame instead of dissimilarity matrix; used only with function |

`comm` |
Community data frame which will be used for finding species scores when the LHS of the formula was a dissimilarity matrix as only allowed for |

`add` |
Logical indicating if an additive constant should be computed, and added to the non-diagonal dissimilarities such that all eigenvalues are non-negative in underlying Principal Co-ordinates Analysis; only applicable in |

`multicomp` |
Categorical variable used to construct the contrasts from. In case that this variable is missing, then the first explanatory variable of the formula will be used. |

`contrast` |
Return the ordination results for the particular contrast indicated by this number (e.g. with 5 levels, one can choose in between contrast 1-10). In case=0, then the first row of the |

`...` |
Other parameters passed to |

This function provides a simple expansion of `capscale`

, `cca`

and `rda`

by conducting the analysis for subsets of the community and environmental datasets that only contain two levels of a categoricl variable.

When the choice is made to return results from all contrasts (contrast=0), then the first row of the `anova.cca`

tables for each contrast are provided. It is therefore possible to compare differences in results by modifying the "by" argument of this function (i.e. obtain the total of explained variance, the variance explained on the first axis or the variance explained by the variable alone).

When the choice is made to return results from a particular contrast (contrast>0), then the ordination result is returned and two new datasets ("newcommunity" and "newenvdata") are created that only contain data for the two selected contrasts.

The function returns an ANOVA table that contains the first rows of the ANOVA tables obtained for all possible combinations of levels of the first variable. Alternatively, it returns an ordination result for the selected contrast and creates two new datasets ("newcommunity" and "newenvdata")

Roeland Kindt (World Agroforestry Centre)

Legendre, P. & Anderson, M.J. (1999). Distance-based redundancy analysis: testing multispecies responses in multifactorial ecological experiments. Ecological Monographs 69: 1-24.

Anderson, M.J. & Willis, T.J. (2003). Canonical analysis of principal coordinates: a useful method of constrained ordination for ecology. Ecology 84: 511-525.

1 2 3 4 5 6 7 8 9 10 11 | ```
## Not run:
library(vegan)
library(MASS)
data(dune)
data(dune.env)
multiconstrained(method="capscale", dune~Management, data=dune.env,
distance="bray",add=TRUE)
multiconstrained(method="capscale", dune~Management, data=dune.env,
distance="bray", add=TRUE, contrast=3)
## End(Not run)
``` |

```
Loading required package: tcltk
Loading required package: vegan
Loading required package: permute
Loading required package: lattice
This is vegan 2.5-4
BiodiversityR 2.11-1: Use command BiodiversityRGUI() to launch the Graphical User Interface;
to see changes use BiodiversityRGUI(changeLog=TRUE, backward.compatibility.messages=TRUE)
Warning message:
no DISPLAY variable so Tk is not available
Multiple comparisons for capscale for all contrasts of Management
Model: multiconstrained(method = "capscale", formula = dune ~ Management, data = dune.env, distance = "bray", add = TRUE)
Df SumOfSqs F Pr(>F)
BF vs. HF 1 0.17660 1.4959 0.194
BF vs. NM 1 0.58097 2.6022 0.023 *
BF vs. SF 1 0.43509 2.2527 0.054 .
HF vs. NM 1 0.67093 3.1966 0.027 *
HF vs. SF 1 0.35062 1.5935 0.125
NM vs. SF 1 0.79117 3.1058 0.006 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Multiple comparisons for capscale for Management
Analysis done with bray distance and add= TRUE
Contrast: BF vs. SF
Call: capscale(formula = newcommunity ~ Management, data = newenvdata,
distance = distance, add = add)
Inertia Proportion Rank
Total 1.7871 1.0000
Constrained 0.4351 0.2435 1
Unconstrained 1.3520 0.7565 7
Inertia is Lingoes adjusted squared Bray distance
Species scores projected from 'newcommunity'
Eigenvalues for constrained axes:
CAP1
0.4351
Eigenvalues for unconstrained axes:
MDS1 MDS2 MDS3 MDS4 MDS5 MDS6 MDS7
0.6286 0.2911 0.2022 0.1185 0.0693 0.0411 0.0012
Constant added to distances: 0.03342492
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.