partialR2: Coefficient of Partial Determination

View source: R/partialR2.R

partialR2R 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]))



spfilteR documentation built on Aug. 23, 2022, 1:06 a.m.