Skip to contents

Front ends for the SLX model \(y = X\beta + WX_*\theta + e\) fitted by OLS on \(Z = (X, WX_*)\) (\(X_*\) the non-constant columns); R arm of the Python modules morie.fn.slx*. Slxwx: \(WX_*\) with column means and correlations. Slxflt: the local deviation \((I - W)X\). Slxres: Moran's I of residuals, exact test when the design \(Z\) is given. Slxboot: residual-bootstrap percentile intervals for \(\theta\) (Philox resampling, type-7 quantiles).

Usage

Slxwx(X, W)

Slxflt(X, W)

Slxres(resid, W, X = NULL)

Slxboot(y, X, W, B = 99, seed = 0, level = 0.95)

Arguments

X

Design matrix including any intercept column (for Slxres, optionally the SLX design).

W

Spatial weights matrix.

resid

Model residuals.

y

Response.

B

Bootstrap replicates.

seed

Philox seed.

level

Confidence level.

Value

A list whose statistic is the headline value, with the components of the Python result's extra.

References

Halleck Vega, S. and Elhorst, J. P. (2015). The SLX model. Journal of Regional Science 55, 339-363.

Efron, B. and Tibshirani, R. J. (1993). An Introduction to the Bootstrap. Chapman and Hall.

Examples

W <- matrix(c(0, .5, 0, 1, 0, 1, 0, .5, 0), 3)
X <- cbind(1, c(0.2, 0.9, 0.4))
Slxwx(X, W)$means
#> [1] 0.7
Slxflt(X, W)$filtered
#>      [,1] [,2]
#> [1,]    0 -0.7
#> [2,]    0  0.6
#> [3,]    0 -0.5