Learn R Programming

HSAR (version 0.3.6)

hsar: Hierarchical SAR model estimation

Description

A Bayesian MCMC approach for estimation of the Hierarchical SAR model of the form: $$Y = \rho W Y + X \beta + Z \gamma +\delta \theta + \epsilon, \theta= \lambda M \theta + u$$ where Y is an Nx1 vector of the outcome variable, X is an NxK matrix of the independent variables, W and M are the weight matrices at the lower and upper level respectively,$\rho$ and $\lambda$ are the autoregressive parameters indicating the strength of spatial interaction at the lower and higher level respectively, $\beta$ is a kx1 vector of regression coefficients to estimate, $\delta$ is a NxJ block diagonal matrix and $\theta$ is a Jx1 vector of the regional effects. Two special cases of HSAR are included as well. In the first one, only the regional effects are considered independent (higher level) so the autoregressive parameter $\lambda$ is zero. In the second only the lower level effects are considered independent and so the autoregressive parameter $\rho$ is zero.

Usage

hsar( X, y, W=NULL, M=NULL, Z, Unum, burnin=5000, Nsim=10000)

Arguments

X
matrix of independent variables
y
vector of outcome variable values
W
spatial weight matrix
M
spatial weight matrix at the higher level
Z
matrix of the higher level variables
Unum
Relation between higher level regions and lower level areas
burnin
Number of samples before start collecting points
Nsim
Total number of samples in MC

Value

  • a list with
  • Mbetasa vector with the mean values of the vector of the regression coefficients estimated
  • SDbetasa vector with the standard deviation of the vector of the regression coefficients estimated
  • MrhoMean values of the strength of the spatial interaction rho
  • SDrhoStandard deviation of rho
  • MlamdaMean values of the strength of the spatial interaction at the higher level
  • SDlambdaStandard deviation of lambda
  • Msigma2eMean value of $\sigma^{2}_{e}$
  • SDsigma2eStandard deviation of $\sigma^{2}_{e}$
  • Msigma2uMean value of $\sigma^{2}_{u}$
  • SDsigma2uStandard deviation of $\sigma^{2}_{u}$
  • MusMean values of $\theta$
  • SDusStandard deviation of $\theta$
  • DICdeviance information criterion (DIC)
  • pdeffective number of parameters
  • Log_LikelihoodLog likelihood
  • R_Squaredpseudo R squared
  • impact_directDirect effect
  • impact_idirectIndirect effect
  • impact_totalTotal effect

Details

In order to run the full HSAR model both W and M matrices need to be defined.In case W is set to NULL only the regional effects are considered independent (higher level) so the autoregressive parameter $\lambda$ is zero. In case M is set to NULL only the lower level effects are considered independent and so the autoregressive parameter $\rho$ is zero. Both W and M can not be set to NULL.

References

Dong, D. and Harris, R. 2014. Spatial Autoregressive Models for Geographically Hierarchical Data Structures. Geographical Analysis, 1-19.

See Also

sar

Examples

Run this code
data(land_prices)
result <- hsar( X, y, W, M, Z, Unum, 50, 100)
result$Mrho

Run the code above in your browser using DataLab