Skip to contents

MoranPermutationTest: I = (n / S0) z'Wz / z'z and the pseudo P-value (1 + #(I_sim >= I)) / (nsim + 1) over Fisher-Yates permutations on Philox stream k (as spdep::moran.mc). SpautolmFit: SAR or CAR error model with case weights by profile likelihood, M = t(I - lambda W) D_w (I - lambda W) (SAR) or (I - lambda W) D_w (CAR), as spatialreg::spautolm. S2slsLag: spatial two-stage least squares with instruments 1, X, WX, W^2 X (and W^3 X and regressors WX for the Durbin model), as sphet::spreg(model = "lag"). GmErrorHet: the heteroskedasticity-robust GM spatial error estimator of Kelejian and Prucha (2010), as sphet::spreg(model = "error", het = TRUE). SpatialJTest: Kelejian-Piras J-test, the t ratio of the H1 prediction in the augmented H0 lag model (method = "sphet" copies sphet::kpjtest's instrument set). SatorraBentler: T_ML / c, c = tr(U Gamma) / df.

Usage

MoranPermutationTest(x, W, nsim = 999, seed = 0)

SpautolmFit(
  y,
  X,
  W,
  weights = NULL,
  family = "SAR",
  intercept = TRUE,
  bounds = c(-0.99, 0.99)
)

S2slsLag(y, X, W, durbin = FALSE, het = FALSE)

GmErrorHet(y, X, W)

SpatialJTest(y, X0, W0, X1, W1, het = FALSE, method = "kelejian")

SatorraBentler(data, sigma, delta, t_ml, df)

Arguments

x

Values for Moran's I.

W

Spatial weights matrix.

nsim

Number of permutations.

seed

Philox seed.

y

Response.

X

Regressor matrix (no intercept column; one is added).

weights

Case weights, or NULL.

family

"SAR" or "CAR".

intercept

Add an intercept column.

bounds

Search interval for the spatial parameter.

durbin

Spatial Durbin model.

het

White-robust variances.

X0, W0, X1, W1

Regressors and weights of the null and alternative models.

method

"kelejian" or "sphet".

data

Data matrix (rows are cases).

sigma

Model-implied covariance matrix.

delta

Jacobian of vech(Sigma(theta)).

t_ml

Maximum-likelihood chi-square.

df

Degrees of freedom.

Value

A list.

References

Moran, P. A. P. (1950). Biometrika 37, 17-23. Bivand, R. S., Pebesma, E. and Gomez-Rubio, V. (2013). Applied Spatial Data Analysis with R, 2nd ed. Kelejian, H. H. and Prucha, I. R. (1998). J. Real Estate Finance Econ. 17, 99-121. Kelejian, H. H. and Prucha, I. R. (2010). J. Econometrics 157, 53-67. Kelejian, H. H. (2008). Letters in Spatial and Resource Sciences 1, 3-11. Satorra, A. and Bentler, P. M. (1994). In Latent Variables Analysis, 399-419.

Examples

W <- rbind(c(0, 1, 0, 0), c(1, 0, 1, 0), c(0, 1, 0, 1), c(0, 0, 1, 0))
MoranPermutationTest(1:4, W, nsim = 19)$statistic
#> [1] 0.3333333