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.

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).

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

Author

Sebastian Juhl

Examples

data(fakedata)
E <- getEVs(W = W, covars = NULL)$vectors

(partition <- vp(y = fakedataset$x1, evecs = E[, 1:10], msr = 100))
#> $R2
#>        ab        bc       abc         a         b         c         d 
#> 0.0000000 0.2467182 0.2467182 0.0000000 0.0000000 0.2467182 0.7532818 
#> 
#> $adjR2
#>        ab        bc       abc         a         b         c         d 
#> 0.0000000 0.1620798 0.1620798 0.0000000 0.0000000 0.1620798 0.8379202 
#> 
#> $msr
#> [1] 100
#> 
#> attr(,"class")
#> [1] "vpart"