# Analyzing species association

`sp.assoc.Rd`

Analyzing species association

    sp.assoc(matr)

## Arguments

matr | standard community matrix , with rows representing sites and columns representing species.

## Details

Computations are based on the following formula.

If, `N`: Number of plots.

`S`: Number of species.

`n`: Number of plots occupied by certain species.

`Tj`: total number of species for each plot. s `t`: mean species number for all the plots.

Then: Variance of species relative frequency is: `sigma^{2}{T}= sum{i}=1^{s}P{i}(1-P{i})`.

Variance of species number is: `S^{2}{T}=({1}{N})sum{j=1}^{N}(T{j}-t)^{2}` .

Species relative frequency: `P{i}={n{i}}{N}`.

Variance ratio:

If `VR > 1` Positively associated,

If `VR < 1` Negative associated

`VR = {S{T}^{2}}/{sigma{T}^{2}}`

`W`: used in comparison with chi square with n degrees of freedom.

`W = VR * N`

## Value

Variance ratio, W, Chisq, etc, see `details`

pi

  Species frequency

N

  Number of plots

S

  Number of species

Tj

  Total number of species for each plot

Numspmean

  Mean number of species

sigmaTsq

  Variance of species relative frequency

STsq

  Variance of species number

var.ratio

  Variance ratio

W

  W statiscit value: used in comparison with chi square.(n)

## References

Zhang Qiaoying, Peng Shaolin, Zhang Sumei, Zhang Yunchun, Hou Yuping. (2008) Association of dormintant species in Guia hill Municipal Park of Macao. Ecology and Environment. 17:1541-1547

GUO zhongling, MA yuandan, ZHENG Jiping, LIU Wande , JIN Zefeng.(2004) Biodiversity of tree species,their populations'spatial distribution pattern and interspecific association in mixed deciduous broadleaved forest in Changbai Mountains. Chinese Journal of Applied Ecology. 15:2013-2018

Shi Zuomin, Liu Shirong, Cheng Ruimei, Jiang Youxu.(2001) Interspecific association of plant populations in deciduous broad leaved forest in Baotianman. Scientia Silvae Sinicae. 37:30-35

## Author

Jinlong Zhang jinlongzhang01@gmail.com

## See also

See also `sp.pair` for association between each pair of species.

## Examples

    data(testdata)
    spmatrix <- data2mat(testdata)
    sp.assoc(spmatrix)
    #> $pi
    #>       sp1       sp2       sp3       sp4       sp5       sp6       sp7
    #> 0.6666667 0.6666667 0.6666667 0.6666667 0.3333333 0.3333333 0.3333333
    #>
    #> $N
    #> [1] 3
    #>
    #> $S
    #> [1] 7
    #>
    #> $Tj
    #> plot1 plot2 plot3
    #>     5     2     4
    #>
    #> $Numspmean
    #> [1] 3.666667
    #>
    #> $sigmaTsq
    #> [1] 1.555556
    #>
    #> $STsq
    #> [1] 1.555556
    #>
    #> $var.ratio
    #> [1] 1
    #>
    #> $W
    #> [1] 3
    #>