-------------------------------------------------------------------------------
help: spweightxt                                                   dialog: spwe
> ightxt
-------------------------------------------------------------------------------

+-------+ ----+ Title +------------------------------------------------------------

spweightxt: Panel Spatial Weight Matrix

+-------------------+ ----+ Table of Contents +------------------------------------------------

Syntax Options Description Saved Results

*** Examples

Author

+--------+ ----+ Syntax +-----------------------------------------------------------

spweightxt varlist , panel(numlist) time(numlist) matrix(weight_name) tabel pt > abel

+---------+ ----+ Options +----------------------------------------------------------

panel Number of all locations units

time Number of time series in each cross section (must be balanced)

matrix Specify name of spatial weight matrix, that will be created

table Display Cross Section Spatial Weight Matrix Table

ptable Display Panel Spatial Weight Matrix Table

+-------------+ ----+ Description +------------------------------------------------------

spweightxt creates or generates both Cross Section and Panel Spatial Weight Matrix among neighbor locations, for using in panel spatial regression analysis.

Raw data for neighbor locations units must be put as shown in the sample data file (spweightxt.dta).

+---------------+ ----+ Saved Results +----------------------------------------------------

spweightxt saves the following results in e():

Matrixes e(wcs) Cross Section Spatial Weight Matrix.{p_end} e(wxt) Panel Spatial Weight Matrix.{p_end}

+----------+ ----+ Examples +---------------------------------------------------------

clear all

sysuse spweightxt.dta, clear

spweightxt v1 v2 , panel(4) time(4) matrix(W)

spweightxt v1 v2 , panel(4) time(4) matrix(W) table

spweightxt v1 v2 , panel(4) time(4) matrix(W) ptable

spweightxt v1 v2 , panel(4) time(4) matrix(W) table ptable

ereturn list

db spweightxt

The final shape of cross section and panel spatial weight matrix will be as follows:.

----------------------------------------- | v2 v1 | 1 2 3 4 Total ------+---------------------------------- 1 | 0 1 1 1 3 2 | 1 0 1 0 2 3 | 1 1 0 1 3 4 | 1 0 1 0 2 ------+---------------------------------- Total | 3 2 3 2 10 -----------------------------------------

(1) (2) (3) (4) |-----------------|-----------------|-----------------|-----------------| (1) | 0 0 0 0 | 1 0 0 0 | 1 0 0 0 | 1 0 0 0 | | 0 0 0 0 | 0 1 0 0 | 0 1 0 0 | 0 1 0 0 | | 0 0 0 0 | 0 0 1 0 | 0 0 1 0 | 0 0 1 0 | | 0 0 0 0 | 0 0 0 1 | 0 0 0 1 | 0 0 0 1 | |-----------------|-----------------|-----------------|-----------------| (2) | 1 0 0 0 | 0 0 0 0 | 1 0 0 0 | 0 0 0 0 | | 0 1 0 0 | 0 0 0 0 | 0 1 0 0 | 0 0 0 0 | | 0 0 1 0 | 0 0 0 0 | 0 0 1 0 | 0 0 0 0 | | 0 0 0 1 | 0 0 0 0 | 0 0 0 1 | 0 0 0 0 | |-----------------|-----------------|-----------------|-----------------| (3) | 1 0 0 0 | 1 0 0 0 | 0 0 0 0 | 1 0 0 0 | | 0 1 0 0 | 0 1 0 0 | 0 0 0 0 | 0 1 0 0 | | 0 0 1 0 | 0 0 1 0 | 0 0 0 0 | 0 0 1 0 | | 0 0 0 1 | 0 0 0 1 | 0 0 0 0 | 0 0 0 1 | |-----------------|-----------------|-----------------|-----------------| (4) | 1 0 0 0 | 0 0 0 0 | 1 0 0 0 | 0 0 0 0 | | 0 1 0 0 | 0 0 0 0 | 0 1 0 0 | 0 0 0 0 | | 0 0 1 0 | 0 0 0 0 | 0 0 1 0 | 0 0 0 0 | | 0 0 0 1 | 0 0 0 0 | 0 0 0 1 | 0 0 0 0 | |-----------------|-----------------|-----------------|------------------

After creating panel 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

+---------------------+ ----+ SPWEIGHTXT Citation +---------------------------------------------- Shehata, Emad Abd Elmessih (2012) SPWEIGHTXT: "Create Panel Spatial Weight Matrix"

http://ideas.repec.org/c/boc/bocode/s457330.html

http://econpapers.repec.org/software/bocbocode/s457330.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 ------------------------------------------------------------------------------- > -