+-------+ ----+ Title +------------------------------------------------------------
spweightxt: Panel Spatial Weight Matrix
+--------+ ----+ Syntax +-----------------------------------------------------------
spweightxt varlist , panel(numlist) time(numlist) matrix(weight_name) tabel pt > abel
+-------------+ ----+ 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).
+---------+ ----+ 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
+---------------+ ----+ 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}
+---------+ ----+ Example +----------------------------------------------------------
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 Assistant Professor 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 (2011) SPWEIGHTXT: "Stata Module to Create Panel Spatial Weight Matrix"
http://ideas.repec.org/c/boc/bocode/s457330.html
http://econpapers.repec.org/software/bocbocode/s457330.htm
Online Help:
spregcs, spregxt, spautoreg, spweight, gs3sls, gs2slsxt, spmstar, spweightcs, spweightxt, spcs2xt (if installed).