Learn R Programming

spmoran (version 0.1.5)

esf: Spatial regression with eigenvector spatial filtering

Description

This function estimates the linear eigenvector spatial filtering (ESF) model. Following many of ESF studies, Moran's eigenvectors are selected by a forward stepwise method.

Usage

esf( y, x = NULL, vif = NULL, meig, fn = "r2" )

Arguments

y

Vector of explained variables (\(N\) x 1)

x

Matrix of explanatory variables (\(N\) x \(K\)). Default is NULL

vif

Maximum permissive value for the variance inflation factor (VIF) (scalar). For example, if \(vif\) = 10, eigenvectors are selected so that the maximum VIF value among explanatory variables and eigenvectors does not exceed 10. Default is NULL

meig

Moran's eigenvectors and eigenvalues. Output from meigen or meigen_f

fn

Objective function for the stepwise eigenvector selection. The adjusted R2 ("r2"), AIC ("aic"), or BIC ("bic") are available. It is possible to introduce all eigenvectors in meig by setting fn = "all". This is allowable for large samples. Default is "r2"

Value

b

Matrix with columns for the estimated coefficients on \(x\), their standard errors, t-values, and p-values (\(K\) x 4)

r

Matrix with columns for the estimated coefficients on Moran's eigenvectors, their standard errors, t-values, and p-values (\(L\) x 4)

vif

Vector of variance inflation factors of the explanatory variables (\(N\) x 1)

e

Vector whose elements are residual standard error (resid_SE), adjusted R2 (adjR2), log-likelihood (logLik), AIC, and BIC

sf

Vector of estimated spatial dependent component (\(E\gamma\)) (\(N\) x 1)

pred

Vector of predicted values (\(N\) x 1)

resid

Vector of residuals (\(N\) x 1)

other

List of other outcomes, which are internally used

References

Tiefelsdorf, M., and Griffith, D. A. (2007). Semiparametric filtering of spatial autocorrelation: the eigenvector approach. Environment and Planning A, 39 (5), 1193-1221.

See Also

resf

Examples

Run this code
# NOT RUN {
require(spdep)
data(boston)
y	<- boston.c[, "CMEDV" ]
x	<- boston.c[,c("CRIM","ZN","INDUS", "CHAS", "NOX","RM", "AGE")]
coords  <- boston.c[,c("LAT","LON")]

#########Distance-based ESF
meig 	<- meigen(coords=coords)
esfD	<- esf(y=y,x=x,meig=meig, vif=5)
esfD$vif
esfD$b
esfD$e

#########Fast approximation
meig_f<- meigen_f(coords=coords)
esfD	<- esf(y=y,x=x,meig=meig_f, vif=10, fn="all")

############################Not run
#########Topoligy-based ESF (it is commonly used in regional science)
#
#cknn	<- knearneigh(coordinates(coords), k=4) #4-nearest neighbors
#cmat	<- nb2mat(knn2nb(cknn), style="B")
#meig <- meigen(cmat=cmat, threshold=0.25)
#esfT	<- esf(y=y,x=x,meig=meig)

# }

Run the code above in your browser using DataLab