This function computes the strength of the association between a species vector and a vector of memberships to the site-group. Several statistics are possible, following De Cáceres and Legendre (2009). The choice of the most appropriate statistic depends on the application. If required, bootstrap confidence interval bounds are also computed.

strassoc(
  X,
  cluster,
  func = "r",
  group = NULL,
  nboot.ci = NULL,
  alpha.ci = 0.05,
  c = 1
)

Arguments

X

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

cluster

A vector of numeric group labels for sites.

func

The association index to be used. Accepted function names: "r", "r.g", "IndVal", "IndVal.g", "A", "A.g", "B", "cos", "cos.g", "r.ind", "r.ind.g", "s.ind", "s.ind.g" (lowercase values are also accepted).

group

Group for which association values are to be computed. If group=NULL, association values will be computed for all groups.

nboot.ci

Number of bootstrap samples. If NULL then confidence intervals are not estimated.

alpha.ci

Error in confidence intervals.

c

Vector of total abundance per site (used in functions "r.ind", "r.ind.g", "s.ind", "s.ind.g" only).

Value

Returns a matrix of association values, where species are in rows and groups are in columns. If nboot.ci is not null, then a list is returned, where 'stat' contains the matrix of association values, and the lower and upper confidence limits are given in supplementary matrices named 'lowerCI' and 'upperCI' respectively.

Details

This R function is applicable to both presence-absence and quantitative species data, depending on the values in the input matrix X. Indices "r","r.g","cos" and "cos.g" correspond to the general correlation generalization ("r" is the point-biserial correlation coefficient), whereas "r.ind", "r.ind.g", "s.ind" and "s.ind.g" correspond to the individual-based generalization. Both approaches give the same results for binary (presence-absence) species data. Indicator value indices "IndVal" and "IndVal.g" are partial generalizations of the indices of the presence-absence indices. The "IndVal" index of Dufrêne & Legendre (1997) is called "IndVal.g" here and strassoc returns the square root of the original index. Indices "A","A.g" and "B" are the asymmetric quantities into which indicator values "IndVal" and "IndVal.g" can be decomposed. See De Cáceres and Legendre for details on the relationships between these indices and their usage. Bootstrap confidence intervals are computed using the simple percentile method (Manly 1997).

Note

This function gives the same association values as function indval in package "labdsv" when used setting func="IndVal.g", 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.

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

Manly, B. F. J. 1997. Randomization, bootstrap and Monte Carlo methods in biology. Chapman and Hall Texts in Statistical Science Series.

See also

Author

Miquel De Cáceres Ainsa, EMF-CREAF

Examples

## Load species data
data(wetland) 

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

## Compute Dufrene and Legendre's IndVal
strassoc(wetland, wetkm$cluster, func="IndVal.g") 
#>                 1         2          3
#> Abefic 0.00000000 0.0000000 0.20851441
#> Merhed 0.00000000 0.0000000 0.36115756
#> Alyvag 0.00000000 0.0000000 0.36115756
#> Pancam 0.20801257 0.0000000 0.67767185
#> Abemos 0.00000000 0.0000000 0.29488391
#> Melcor 0.30553764 0.1588796 0.74077982
#> Ludoct 0.00000000 0.0000000 0.20851441
#> Eupvac 0.29258835 0.0000000 0.57287934
#> Echpas 0.44940737 0.0000000 0.40642058
#> Passcr 0.00000000 0.0000000 0.20851441
#> Poa2   0.00000000 0.0000000 0.20851441
#> Carhal 0.08955493 0.3292895 0.21475400
#> Dendio 0.27735010 0.0000000 0.00000000
#> Casobt 0.27735010 0.0000000 0.00000000
#> Aesind 0.00000000 0.0000000 0.51075392
#> Cyprot 0.00000000 0.0000000 0.51075392
#> Ipocop 0.00000000 0.0000000 0.36115756
#> Cynarc 0.00000000 0.0000000 0.55167728
#> Walind 0.29350699 0.2698030 0.27821480
#> Sessp. 0.40303098 0.2963854 0.44986918
#> Phynod 0.08297088 0.0000000 0.77058948
#> Echell 0.22175584 0.1921884 0.48544074
#> Helind 0.47423856 0.3106919 0.40384074
#> Ipoaqu 0.15272652 0.5956334 0.23640714
#> Orysp. 0.74716292 0.6023820 0.14345140
#> Elesp. 0.23851300 0.7160688 0.26106172
#> Psespi 0.10344560 0.9509121 0.04773995
#> Ludads 0.43852901 0.8498366 0.00000000
#> Polatt 0.48038446 0.0000000 0.00000000
#> Poa1   0.00000000 0.0000000 0.20851441
#> Helcri 0.00000000 0.0000000 0.20851441
#> Physp. 0.27735010 0.0000000 0.00000000
#> Goopur 0.27735010 0.0000000 0.00000000

## Compute correlation, with bootstrap 95 percent confidence intervals
strassoc(wetland, wetkm$cluster, func="r.g", 
         nboot.ci =100) 
#> $stat
#>                  1           2           3
#> Abefic -0.08574929 -0.08574929  0.17149859
#> Merhed -0.14177624 -0.14177624  0.28355248
#> Alyvag -0.14177624 -0.14177624  0.28355248
#> Pancam -0.13107203 -0.29959322  0.43066525
#> Abemos -0.12216944 -0.12216944  0.24433889
#> Melcor -0.17511960 -0.40027338  0.57539298
#> Ludoct -0.08574929 -0.08574929  0.17149859
#> Eupvac  0.04402886 -0.38996989  0.34594103
#> Echpas  0.23121640 -0.40187613  0.17065973
#> Passcr -0.08574929 -0.08574929  0.17149859
#> Poa2   -0.08574929 -0.08574929  0.17149859
#> Carhal -0.18125284  0.16523181  0.01602103
#> Dendio  0.22941573 -0.11470787 -0.11470787
#> Casobt  0.22941573 -0.11470787 -0.11470787
#> Aesind -0.20695934 -0.20695934  0.41391868
#> Cyprot -0.19307082 -0.19307082  0.38614164
#> Ipocop -0.15075567 -0.15075567  0.30151134
#> Cynarc -0.22557694 -0.22557694  0.45115388
#> Walind -0.05500026  0.03157809  0.02342216
#> Sessp.  0.14157331 -0.18091005  0.03933674
#> Phynod -0.27454999 -0.37531568  0.64986568
#> Echell -0.13983138 -0.17287373  0.31270511
#> Helind  0.15480258 -0.16887555  0.01407296
#> Ipoaqu -0.25931248  0.36811712 -0.10880463
#> Orysp.  0.63019150  0.08274097 -0.71293247
#> Elesp. -0.27056424  0.56066381 -0.29009957
#> Psespi -0.38371323  0.83048252 -0.44676929
#> Ludads -0.09447723  0.66134064 -0.56686340
#> Polatt  0.34360407 -0.17180203 -0.17180203
#> Poa1   -0.08574929 -0.08574929  0.17149859
#> Helcri -0.08574929 -0.08574929  0.17149859
#> Physp.  0.22941573 -0.11470787 -0.11470787
#> Goopur  0.22941573 -0.11470787 -0.11470787
#> 
#> $lowerCI
#>                  1          2            3
#> Abefic -0.14744196 -0.1474420  0.000000000
#> Merhed -0.23677853 -0.2367785  0.000000000
#> Alyvag -0.22316092 -0.2231609  0.000000000
#> Pancam -0.27639631 -0.4802367  0.264030383
#> Abemos -0.20000000 -0.2000000  0.000000000
#> Melcor -0.48681955 -0.6696068  0.284361939
#> Ludoct -0.16666667 -0.1666667  0.000000000
#> Eupvac -0.34123065 -0.5003251 -0.039270101
#> Echpas -0.08832733 -0.5264998 -0.167168873
#> Passcr -0.16116459 -0.1611646  0.000000000
#> Poa2   -0.14744196 -0.1474420  0.000000000
#> Carhal -0.46875467 -0.2468643 -0.370292548
#> Dendio  0.00000000 -0.2236068 -0.223606798
#> Casobt  0.00000000 -0.2236068 -0.223606798
#> Aesind -0.28961945 -0.2896194  0.194257172
#> Cyprot -0.27059854 -0.2705985  0.229415734
#> Ipocop -0.23312620 -0.2331262  0.000000000
#> Cynarc -0.30395335 -0.3039533  0.236624262
#> Walind -0.41519078 -0.3533491 -0.469409619
#> Sessp. -0.34271539 -0.4694311 -0.220234468
#> Phynod -0.42217985 -0.4604612  0.442405870
#> Echell -0.36913484 -0.4008971  0.001791258
#> Helind -0.27759114 -0.5279709 -0.276877905
#> Ipoaqu -0.53606053 -0.3162278 -0.443202630
#> Orysp.  0.35213959 -0.2202729 -0.865497307
#> Elesp. -0.49684245  0.1223121 -0.544993085
#> Psespi -0.50108260  0.7236426 -0.554757607
#> Ludads -0.25000000  0.5565336 -0.877058019
#> Polatt  0.00000000 -0.3040080 -0.304007978
#> Poa1   -0.15811388 -0.1581139  0.000000000
#> Helcri -0.15811388 -0.1581139  0.000000000
#> Physp.  0.00000000 -0.2390457 -0.239045722
#> Goopur  0.00000000 -0.2390457 -0.239045722
#> 
#> $upperCI
#>                  1           2          3
#> Abefic  0.00000000  0.00000000  0.2886751
#> Merhed  0.00000000  0.00000000  0.4352858
#> Alyvag  0.00000000  0.00000000  0.3956634
#> Pancam  0.06167062 -0.24433889  0.5780141
#> Abemos  0.00000000  0.00000000  0.3922323
#> Melcor  0.05283955  0.01270219  0.7808363
#> Ludoct  0.00000000  0.00000000  0.3287980
#> Eupvac  0.30347585 -0.29678870  0.6824613
#> Echpas  0.54651362 -0.28617574  0.3548682
#> Passcr  0.00000000  0.00000000  0.2948839
#> Poa2    0.00000000  0.00000000  0.2886751
#> Carhal  0.07491310  0.72289999  0.3326739
#> Dendio  0.42640143  0.00000000  0.0000000
#> Casobt  0.42640143  0.00000000  0.0000000
#> Aesind -0.13130643 -0.13130643  0.5423261
#> Cyprot -0.11952286 -0.11952286  0.5121475
#> Ipocop -0.08058230 -0.08058230  0.4517540
#> Cynarc -0.13867505 -0.13867505  0.5919163
#> Walind  0.28335838  0.56803888  0.3151400
#> Sessp.  0.43013160  0.11633653  0.3428803
#> Phynod -0.10186089 -0.28518100  0.8201492
#> Echell  0.12208534  0.10842201  0.5382201
#> Helind  0.50389830  0.15276828  0.2875168
#> Ipoaqu  0.05204296  0.81424541  0.1767767
#> Orysp.  0.82010623  0.38574063 -0.5935401
#> Elesp. -0.02223320  0.87580617 -0.0462254
#> Psespi -0.29179753  0.96770463 -0.3772824
#> Ludads  0.26650090  0.79540457 -0.5000000
#> Polatt  0.53935989  0.00000000  0.0000000
#> Poa1    0.00000000  0.00000000  0.3086067
#> Helcri  0.00000000  0.00000000  0.3086067
#> Physp.  0.42640143  0.00000000  0.0000000
#> Goopur  0.42640143  0.00000000  0.0000000
#>