This function computes the permutation p-value of the association between a species vector and a vector of memberships to a site-group. Four different tests of hypotheses arise from considering either presence/absence or quantitative species data, and from using a non-equalized or group-equalized approach.

signassoc(
  X,
  U = NULL,
  cluster = NULL,
  mode = 1,
  alternative = "greater",
  control = how(),
  permutations = NULL,
  print.perm = FALSE
)

Arguments

X

Community data table (rows are sites, columns are species).

U

A matrix of group memberships. Each column corresponds to one site-group. Membership values can be crisp or fuzzy. If this matrix is not provided, vector gmv will be used.

cluster

A vector of numeric group labels for sites.

mode

Association mode, 0 (site-based) or 1 (group-based).

alternative

Alternative statistical hypothesis: "greater" (positive association), "less" (negative association), "two.sided" (either positive or negative).

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

Returns a matrix of p-values, where species are in rows and groups are in columns. Two additional columns indicate the group with lowest p-value and the p-value for this group after Sidak's correction for multiple testing.

Details

Input data for this function is the species matrix X and either a matrix of group memberships (U) or a vector of numeric group labels (cluster). This R function works for both presence/absence and quantitative species data, depending on the values of the input matrix X. If mode = 0, the null ecological hypothesis is that the frequency (or abundance) of the species of interest in sites belonging to the site group is not higher than the frequency (or abundance) in sites not belonging to it. If mode = 1, the null ecological hypothesis is that the relative frequency (average abundance) of the species of interest is not higher in the target site group than in other groups. See De Cáceres and Legendre for more details.

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

Users should be aware that the significance test in signassoc is not exactly the same as the one in indval from labdsv package. The signassoc function is using the preference for the target group (either non-equalized or group-equalized) as test statistic. After every permutation the preference for the target group is recalculated. The function is therefore testing the null hypothesis stating that the preference of the species for a given site group is due to chance only (as in Bakker 2008). The test is repeated for every group, and this is the reason why there are as many p-values as groups. In contrast, the indval function from labdsv package uses the maximum preference value as test statistic, and the maximum preference value is recalculated after each permutation. The maximum preference may correspond to other groups than the one chosen for the unpermuted data. indval function from labdsv package is therefore testing the null hypothesis saying that the group with observed maximum preference is not such, because the maximum preference was in that group due to chance only. In order to get the consistent results compared to the indval function, users should use the function multipatt, along with the option duleg=TRUE.

References

Bakker, J. 2008. Increasing the utility of Indicator Species Analysis. Journal of Applied Ecology 45: 1829-1835.

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

See also

Author

Miquel De Cáceres Ainsa, EMF-CREAF

Examples

library(stats)

data(wetland) ## Load species data

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

## Look for species whose abundance is significantly higher in one of the three groups
signassoc(wetland, cluster=wetkm$cluster, mode=1, control = how(nperm=999))
#>            1     2     3 best      psidak
#> Abefic 1.000 1.000 0.549    3 0.908266149
#> Merhed 1.000 1.000 0.190    3 0.468559000
#> Alyvag 1.000 1.000 0.148    3 0.381529792
#> Pancam 0.885 1.000 0.007    3 0.020853343
#> Abemos 1.000 1.000 0.306    3 0.665744616
#> Melcor 0.723 1.000 0.001    3 0.002997001
#> Ludoct 1.000 1.000 0.588    3 0.930065472
#> Eupvac 0.555 1.000 0.036    3 0.104158656
#> Echpas 0.317 1.000 0.213    3 0.512556597
#> Passcr 1.000 1.000 0.560    3 0.914816000
#> Poa2   1.000 1.000 0.538    3 0.901388872
#> Carhal 0.564 1.000 0.383    3 0.765114887
#> Dendio 0.405 1.000 1.000    1 0.789355125
#> Casobt 0.386 1.000 1.000    1 0.768524456
#> Aesind 1.000 1.000 0.025    3 0.073140625
#> Cyprot 1.000 1.000 0.024    3 0.070285824
#> Ipocop 1.000 1.000 0.179    3 0.446612339
#> Cynarc 1.000 1.000 0.008    3 0.023808512
#> Walind 0.326 1.000 0.327    1 0.693817976
#> Sessp. 0.108 1.000 0.242    1 0.290267712
#> Phynod 0.999 1.000 0.001    3 0.002997001
#> Echell 0.637 1.000 0.043    3 0.123532507
#> Helind 0.449 0.622 0.547    1 0.832715849
#> Ipoaqu 0.741 0.293 0.770    2 0.646606757
#> Orysp. 0.116 0.195 1.000    1 0.309192896
#> Elesp. 0.025 1.000 0.580    1 0.073140625
#> Psespi 0.356 0.229 0.995    2 0.541685989
#> Ludads 0.220 0.169 1.000    2 0.426143809
#> Polatt 0.809 0.001 1.000    2 0.002997001
#> Poa1   1.000 1.000 0.574    3 0.922691224
#> Helcri 1.000 1.000 0.574    3 0.922691224
#> Physp. 0.390 1.000 1.000    1 0.773019000
#> Goopur 0.390 1.000 1.000    1 0.773019000

## Look for species whose abundance is significantly higher in sites belonging 
## to one group as opposed to sites not belonging to it.
signassoc(wetland, cluster=wetkm$cluster, mode=0, control = how(nperm=999)) 
#>            1     2     3 best      psidak
#> Abefic 1.000 1.000 0.521    3 0.890097761
#> Merhed 1.000 1.000 0.174    3 0.436440024
#> Alyvag 1.000 1.000 0.165    3 0.417817125
#> Pancam 0.998 1.000 0.005    3 0.014925125
#> Abemos 1.000 1.000 0.323    3 0.689711267
#> Melcor 0.999 1.000 0.002    3 0.005988008
#> Ludoct 1.000 1.000 0.574    3 0.922691224
#> Eupvac 0.959 1.000 0.070    3 0.195643000
#> Echpas 0.642 1.000 0.439    3 0.823441519
#> Passcr 1.000 1.000 0.551    3 0.909481151
#> Poa2   1.000 1.000 0.550    3 0.908875000
#> Carhal 0.687 1.000 0.422    3 0.806899448
#> Dendio 0.353 1.000 1.000    1 0.729159977
#> Casobt 0.402 1.000 1.000    1 0.786152808
#> Aesind 1.000 1.000 0.028    3 0.081669952
#> Cyprot 1.000 1.000 0.019    3 0.055923859
#> Ipocop 1.000 1.000 0.168    3 0.424069632
#> Cynarc 1.000 1.000 0.010    3 0.029701000
#> Walind 0.522 1.000 0.507    3 0.880176843
#> Sessp. 0.350 1.000 0.595    1 0.725375000
#> Phynod 1.000 1.000 0.001    3 0.002997001
#> Echell 0.944 1.000 0.070    3 0.195643000
#> Helind 0.457 0.759 0.683    1 0.839896993
#> Ipoaqu 0.694 0.406 0.667    2 0.790415416
#> Orysp. 0.001 0.205 1.000    1 0.002997001
#> Elesp. 0.063 1.000 0.932    1 0.177343047
#> Psespi 0.019 0.240 0.998    1 0.055923859
#> Ludads 0.001 0.193 1.000    1 0.002997001
#> Polatt 0.777 0.003 1.000    2 0.008973027
#> Poa1   1.000 1.000 0.563    3 0.916546547
#> Helcri 1.000 1.000 0.563    3 0.916546547
#> Physp. 0.372 1.000 1.000    1 0.752326848
#> Goopur 0.372 1.000 1.000    1 0.752326848