vp: Variance Partitioning with Moran Spectral Randomization

Description Usage Arguments Value Note Author(s) References See Also Examples

View source: R/vp.R

Description

This function decomposes the variation in an outcome variable into four fractions: a) the influence of covariates, b) joint influence of covariates and space, c) the influence of space, and d) unexplained residual variation. Moran spectral randomization is applied to obtain the expected value of the coefficient of determination adjusted for spurious correlations.

Usage

1
vp(y, x = NULL, evecs = NULL, msr = 100)

Arguments

y

outcome vector

x

vector/ matrix of covariates

evecs

selected eigenvectors

msr

number of permutations to compute the expected value under H0

Value

Returns an object of class vpart which provides the following information:

R2

unadjusted fractions of explained variation

adjR2

adjusted fractions (based on Moran spectral randomization)

msr

number of permutations to obtain the expected value under H0

Note

The adjusted R-squared values are obtained by: 1 - (1 - R2) / (1 - E(R2|H0)). For fractions [ab] and [a], Moran spectral randomization is used to derive E(R2|H0). To this end, the rows in matrix (or column vector) x are randomly permuted in order to preserve the correlation structure (see e.g., Clappe et al. 2018).

Author(s)

Sebastian Juhl

References

Clappe, Sylvie, Dray St├ęphane. and Pedro R. Peres-Neto (2018): Beyond neutrality: disentangling the effects of species sorting and spurious correlations in community analysis. Ecology 99 (8): pp. 1737 - 1747.

Wagner, Helene H., and St├ęphane Dray (2015): Generating spatially constrained null models for irregularly spaced data using Moran spectral randomization methods. Methods in Ecology and Evolution 6 (10): pp. 1169 - 1178.

See Also

getEVs

Examples

1
2
3
4
data(fakedata)
E <- getEVs(W = W, covars = NULL)$vectors

(partition <- vp(y = fakedataset$x1, evecs = E[, 1:10], msr = 100))

spfilteR documentation built on Oct. 5, 2021, 9:10 a.m.