spaa: Species pairwise association analysis

Description Usage Arguments Value Note See Also

Description

Calculates association metrics between all pairs of species in the dataset.

Usage

1
spaa(x, method, asymmetric, ...)

Arguments

x

data.frame where each column is a species. Rows can be sites or visits; if visits, using or.glmer with a grouping factor might be a good idea.

method

Name of the function to be used to calculate the degree of association between two species.

asymmetric

If FALSE (the default), the pairwise association metric is assumed to be symmetric, and the function returns a data.frame with nrow(x)=choose(ncol(x), 2). If TRUE, the output has twice this many rows, with both directions of the association being calculated separately.

...

further information passed to 'method'

Value

A 3-column data.frame containing the names of the pair of species in question ($sp1, $sp2) the requested association metric ($value). If the specified function returns more than one value, then this function returns multiple columns (e.g. method="glmer.coef").

Note

Be aware that this function can take a long time to run for large matrices. Methods for calculating pairwise associations in this package include:

fisher.test.pval

Significance of association using Fisher's exact test

glmer.coef

Effect of species A on species B from mixed models; returns slope, se, z and p

mutual.information

Mutual information as defined in information theory

or.asymmetric

Asymmetric odds ratio using contingency tables

or.glm

Asymmetric odds ratio using logisitic regression

or.glmer

Asymmetric odds ratio using logisitic mixed models (using lme4)

or.symmetric

The default; symmetric odds ratio using contingency tables

See Also

plot.spaa


mjwestgate/sppairs documentation built on May 23, 2019, 1:05 a.m.