partialR2 {spfilteR}R Documentation

Coefficient of Partial Determination

Description

This function computes the partial R-squared of all selected eigenvectors in a spatially filtered linear regression model.

Usage

partialR2(y, x = NULL, evecs)

Arguments

y

response variable

x

vector/ matrix of regressors

evecs

(selected) eigenvectors

Value

Vector of partial R-squared values of the eigenvectors.

Note

The function assumes a linear regression model. Since the eigenvectors are mutually uncorrelated, partialR2 evaluates them sequentially. In generalized linear models, the presence of a link function can corrupt the uncorrelatedness of the eigenvectors.

Author(s)

Sebastian Juhl

See Also

lmFilter, getEVs

Examples

data(fakedata)
y <- fakedataset$x1
x <- fakedataset$x2

# get eigenvectors
E <-getEVs(W = W, covars = NULL)$vectors

(out <- partialR2(y = y, x = x, evecs = E[, 1:5]))



[Package spfilteR version 1.1.5 Index]