Skip to contents

This function studies the association between species patterns and combinations of groups of sites.

Usage

multipatt(
  x,
  cluster,
  func = "IndVal.g",
  duleg = FALSE,
  restcomb = NULL,
  min.order = 1,
  max.order = NULL,
  control = how(),
  permutations = NULL,
  print.perm = FALSE
)

Arguments

x

Community data table

cluster

A vector representing a partition of sites

func

Species-site group association function. Four values are accepted "IndVal", "IndVal.g", "r" and "r.g" (lowercase values are also accepted).

duleg

If TRUE, site group combinations are not considered, only the original site groups, like in Dufrêne & Legendre (1997). Internally, duleg = TRUE equals max.order = 1.

restcomb

A vector of integer values used to restrict the combinations of site groups to those with ecological sense according to the analyst. The default NULL indicates that all combinations are used. If duleg=TRUE this argument is ignored.

min.order

An integer indicating the minimum order of site group combinations (by default max.order=1 for singletons). Cannot be larger than max.order.

max.order

An integer indicating the maximum order of site group combinations to be considered: max.order=1 for singletons, max.order=2 for pairs, max.order=3 for triplets... As restcomb, this parameter provide a way to restrict the site group combinations that make ecological sense. By default all possible site group combinations are considered. If max.order=1 then the function will behave as if duleg=TRUE.

control

A list of control values describing properties of the permutation design, as returned by a call to how.

permutations

A custom matrix of permutations, to be used if control = NULL, with permutations in rows and site indices in columns

print.perm

If TRUE, prints permutation numbers after each set of 100 permutations.

Value

An object of class multipatt with:

func

The name of the function used.

comb

A matrix describing all the combinations studied.

str

A matrix the association strength for all combinations studied.

A

If func = "IndVal" (or func = "IndVal.g") a matrix whose values are the "A" (or "A.g") component of indicator values. Otherwise this element is left as NULL.

B

If func = "IndVal" (or func = "IndVal.g") a matrix whose values are the "B" component of indicator values. Otherwise this element is left as NULL.

sign

Data table with results of the best matching pattern, the association value and the degree of statistical significance of the association (i.e. p-values from permutation test). Note that p-values are not corrected for multiple testing.

Details

This function creates combinations of the input clusters and compares each combination with the species in the input matrix x. For each species it chooses the combination with a highest association value. Best matching patterns are tested for statistical significance of the associations. Four association indices are possible (some less than for strassoc): "IndVal", "IndVal.g", "r" and "r.g". Indicator value indices will return the pattern that better matches the species observed pattern, whereas correlation indices will return the pattern that creates a highest inside/outside difference. Details are given in De Cáceres et al. (2010). The user can restrict the combinations in three ways: (1) by using duleg=TRUE, which leads to consider single site-groups only; (2) by setting the minimum and maximum order of combinations using min.order and max.order; or (3) by using restcomb to restrict combinations at will. In order to carry out the third way, values in restcomb must be the indices of combinations that appear in the column index of object sign (see below).

Complex permutation designs are allowed through the function how from package "permute". If those are not enough, the user can set control = NULL and specify a custom matrix of permutations to test with parameter permutations.

Note

This function gives the same results as function indval in package "labdsv" when used setting func="IndVal.g" and duleg=TRUE, excepting the fact that the square root IndVal values is returned instead of the original IndVal.

References

De Cáceres, M. and Legendre, P. 2009. Associations between species and groups of sites: indices and statistical inference. Ecology 90(12): 3566-3574.

De Cáceres, M., Legendre, P., Moretti, M. 2010. Improving indicator species analysis by combining groups of sites. Oikos 119(10): 1674-1684.

Dufrêne, M. and P. Legendre. 1997. Species assemblages and indicator species: The need for a flexible asymetrical approach. Ecological Monographs 67:345-366.

Author

Miquel De Cáceres Ainsa, EMF-CREAF

Florian Jansen, Institute of Botany and Landscape Ecology, Ernst-Moritz-Arndt-University

Examples

library(stats)

data(wetland) ## Loads species data

wetkm <- kmeans(wetland, centers=3) ## Creates three clusters using kmeans

## Runs the combination analysis using IndVal.g as statistic
wetpt <- multipatt(wetland, wetkm$cluster, control = how(nperm=999)) 

## Lists those species with significant association to one combination
summary(wetpt) 
#> 
#>  Multilevel pattern analysis
#>  ---------------------------
#> 
#>  Association function: IndVal.g
#>  Significance level (alpha): 0.05
#> 
#>  Total number of species: 33
#>  Selected number of species: 12 
#>  Number of species associated to 1 group: 9 
#>  Number of species associated to 2 groups: 3 
#> 
#>  List of species associated to each combination: 
#> 
#>  Group 1  #sps.  4 
#>         stat p.value    
#> Pancam 0.783   0.003 ** 
#> Eupvac 0.771   0.001 ***
#> Cynarc 0.762   0.001 ***
#> Merhed 0.548   0.008 ** 
#> 
#>  Group 2  #sps.  3 
#>         stat p.value    
#> Ludads 0.907   0.001 ***
#> Orysp. 0.856   0.001 ***
#> Psespi 0.602   0.017 *  
#> 
#>  Group 3  #sps.  2 
#>         stat p.value    
#> Phynod 0.963   0.001 ***
#> Aesind 0.538   0.035 *  
#> 
#>  Group 1+3  #sps.  1 
#>         stat p.value    
#> Melcor 0.876   0.001 ***
#> 
#>  Group 2+3  #sps.  2 
#>         stat p.value   
#> Helind 0.758   0.006 **
#> Elesp. 0.741   0.005 **
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

## Lists those species with significant association to one combination, 
## including indval components.
summary(wetpt, indvalcomp=TRUE) 
#> 
#>  Multilevel pattern analysis
#>  ---------------------------
#> 
#>  Association function: IndVal.g
#>  Significance level (alpha): 0.05
#> 
#>  Total number of species: 33
#>  Selected number of species: 12 
#>  Number of species associated to 1 group: 9 
#>  Number of species associated to 2 groups: 3 
#> 
#>  List of species associated to each combination: 
#> 
#>  Group 1  #sps.  4 
#>             A      B  stat p.value    
#> Pancam 0.7672 0.8000 0.783   0.003 ** 
#> Eupvac 0.6607 0.9000 0.771   0.001 ***
#> Cynarc 0.9686 0.6000 0.762   0.001 ***
#> Merhed 1.0000 0.3000 0.548   0.008 ** 
#> 
#>  Group 2  #sps.  3 
#>             A      B  stat p.value    
#> Ludads 1.0000 0.8235 0.907   0.001 ***
#> Orysp. 0.7330 1.0000 0.856   0.001 ***
#> Psespi 0.8811 0.4118 0.602   0.017 *  
#> 
#>  Group 3  #sps.  2 
#>             A      B  stat p.value    
#> Phynod 0.9278 1.0000 0.963   0.001 ***
#> Aesind 0.8108 0.3571 0.538   0.035 *  
#> 
#>  Group 1+3  #sps.  1 
#>             A      B  stat p.value    
#> Melcor 0.8764 0.8750 0.876   0.001 ***
#> 
#>  Group 2+3  #sps.  2 
#>             A      B  stat p.value   
#> Helind 0.9381 0.6129 0.758   0.006 **
#> Elesp. 1.0000 0.5484 0.741   0.005 **
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1