+-------+ ----+ Title +------------------------------------------------------------
spweightcs: Cross Section Spatial Weight Matrix
+-------------------+ ----+ Table of Contents +------------------------------------------------
Syntax Options Description Saved Results
*** Examples
Author
+--------+ ----+ Syntax +-----------------------------------------------------------
spweightcs varlist , panel(numlist) matrix(weight_name) notabel
+---------+ ----+ Options +----------------------------------------------------------
panel Number of all locations units
matrix Specify name of spatial weight matrix, that will be created
table Display Cross Section Spatial Weight Matrix Table
+-------------+ ----+ Description +------------------------------------------------------
spweightcs creates or generates cross section spatial weight matrix among neighbor locations, for using in spatial regression analysis.
Raw data for neighbor locations must be put as shown in the sample data file (spweightcs.dta).
+---------------+ ----+ Saved Results +----------------------------------------------------
spweightcs saves the following results in e():
Matrixes e(wcs) Cross Section Spatial Weight Matrix.{p_end}
+----------+ ----+ Examples +---------------------------------------------------------
clear all
sysuse spweightcs.dta, clear
spweightcs v1 v2 , panel(7) matrix(W)
spweightcs v1 v2 , panel(7) matrix(W) table
ereturn list
db spweightcs
The final shape of cross section spatial weight matrix will be as follows:.
------------------------------------- | # | 1 2 3 4 5 6 7 | |-----------------------------------| | 1 | 0 1 0 0 1 1 0 | | 2 | 1 0 1 0 0 1 1 | | 3 | 0 1 0 1 0 0 1 | | 4 | 0 0 1 0 0 0 0 | | 5 | 1 0 0 0 0 1 0 | | 6 | 1 1 0 0 1 0 1 | | 7 | 0 1 1 0 0 1 0 | -------------------------------------
After creating spatial weight matrix, you can use spautoreg (if installed) to generate eigenvalues vector and standardized weight matrix.
+--------+ ----+ Author +-----------------------------------------------------------
Emad Abd Elmessih Shehata Professor (PhD Economics) Agricultural Research Center - Agricultural Economics Research Institute - Eg > ypt Email: emadstat@hotmail.com WebPage: http://emadstat.110mb.com/stata.htm WebPage at IDEAS: http://ideas.repec.org/f/psh494.html WebPage at EconPapers: http://econpapers.repec.org/RAS/psh494.htm
+---------------------+ ----+ SPWEIGHTCS Citation +----------------------------------------------
Shehata, Emad Abd Elmessih (2012) SPWEIGHTCS: "Create Cross Section Spatial Weight Matrix"
http://ideas.repec.org/c/boc/bocode/s457325.html
http://econpapers.repec.org/software/bocbocode/s457325.htm
Online Help:
*** Spatial Econometrics Regression Models:
------------------------------------------------------------------------------- > - *** (1) Spatial Panel Data Regression Models: spregxt Spatial Panel Regression Econometric Models: Stata Module Toolkit gs2slsxt Generalized Spatial Panel 2SLS Regression gs2slsarxt Generalized Spatial Panel Autoregressive 2SLS Regression spglsxt Spatial Panel Autoregressive Generalized Least Squares Regression spgmmxt Spatial Panel Autoregressive Generalized Method of Moments Regress > ion spmstarxt (m-STAR) Spatial Lag Panel Models spmstardxt (m-STAR) Spatial Durbin Panel Models spmstardhxt (m-STAR) Spatial Durbin Multiplicative Heteroscedasticity Panel Mo > dels spmstarhxt (m-STAR) Spatial Lag Multiplicative Heteroscedasticity Panel Model > s spregdhp Spatial Panel Han-Philips Linear Dynamic Regression: Lag & Durbin > Models spregdpd Spatial Panel Arellano-Bond Linear Dynamic Regression: Lag & Durbi > n Models spregfext Spatial Panel Fixed Effects Regression: Lag & Durbin Models spregrext Spatial Panel Random Effects Regression: Lag & Durbin Models spregsacxt MLE Spatial AutoCorrelation Panel Regression (SAC) spregsarxt MLE Spatial Lag Panel Regression (SAR) spregsdmxt MLE Spatial Durbin Panel Regression (SDM) spregsemxt MLE Spatial Error Panel Regression (SEM) ------------------------------------------------------------------------------- > - *** (2) Spatial Cross Section Regression Models: spregcs Spatial Cross Section Regression Econometric Models: Stata Module > Toolkit gs2sls Generalized Spatial 2SLS Cross Sections Regression gs2slsar Generalized Spatial Autoregressive 2SLS Cross Sections Regression gs3sls Generalized Spatial Autoregressive 3SLS Regression gs3slsar Generalized Spatial Autoregressive 3SLS Cross Sections Regression gsp3sls Generalized Spatial 3SLS Cross Sections Regression spautoreg Spatial Cross Section Regression Models spgmm Spatial Autoregressive GMM Cross Sections Regression spmstar (m-STAR) Spatial Lag Cross Sections Models spmstard (m-STAR) Spatial Durbin Cross Sections Models spmstardh (m-STAR) Spatial Durbin Multiplicative Heteroscedasticity Cross Se > ctions Models spmstarh (m-STAR) Spatial Lag Multiplicative Heteroscedasticity Cross Secti > ons Models spregsac MLE Spatial AutoCorrelation Cross Sections Regression (SAC) spregsar MLE Spatial Lag Cross Sections Regression (SAR) spregsdm MLE Spatial Durbin Cross Sections Regression (SDM) spregsem MLE Spatial Error Cross Sections Regression (SEM) ------------------------------------------------------------------------------- > - *** (3) Tobit Spatial Regression Models:
*** (3-1) Tobit Spatial Panel Data Regression Models: sptobitgmmxt Tobit Spatial GMM Panel Regression sptobitmstarxtTobit (m-STAR) Spatial Lag Panel Models sptobitmstardxtTobit (m-STAR) Spatial Durbin Panel Models sptobitmstardhxtTobit (m-STAR) Spatial Durbin Multiplicative Heteroscedasticity > Panel Models sptobitmstarhxtTobit (m-STAR) Spatial Lag Multiplicative Heteroscedasticity Pan > el Models sptobitsacxt Tobit MLE Spatial AutoCorrelation (SAC) Panel Regression sptobitsarxt Tobit MLE Spatial Lag Panel Regression sptobitsdmxt Tobit MLE Spatial Panel Durbin Regression sptobitsemxt Tobit MLE Spatial Error Panel Regression spxttobit Tobit Spatial Panel Autoregressive GLS Regression -------------------------------------------------------------- *** (3-2) Tobit Spatial Cross Section Regression Models: sptobitgmm Tobit Spatial GMM Cross Sections Regression sptobitmstar Tobit (m-STAR) Spatial Lag Cross Sections Models sptobitmstardTobit (m-STAR) Spatial Durbin Cross Sections Models sptobitmstardhTobit (m-STAR) Spatial Durbin Multiplicative Heteroscedasticity C > ross Sections sptobitmstarhTobit (m-STAR) Spatial Lag Multiplicative Heteroscedasticity Cross > Sections sptobitsac Tobit MLE AutoCorrelation (SAC) Cross Sections Regression sptobitsar Tobit MLE Spatial Lag Cross Sections Regression sptobitsdm Tobit MLE Spatial Durbin Cross Sections Regression sptobitsem Tobit MLE Spatial Error Cross Sections Regression ------------------------------------------------------------------------------- > - *** (4) Spatial Weight Matrix: spcs2xt Convert Cross Section to Panel Spatial Weight Matrix spweight Cross Section and Panel Spatial Weight Matrix spweightcs Cross Section Spatial Weight Matrix spweightxt Panel Spatial Weight Matrix ------------------------------------------------------------------------------- > -