+-------+ ----+ Title +------------------------------------------------------------
spweightcs: Cross Section Spatial Weight Matrix
+--------+ ----+ Syntax +-----------------------------------------------------------
spweightcs varlist , panel(numlist) matrix(weight_name) notabel
+-------------+ ----+ 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).
+---------+ ----+ 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
+---------------+ ----+ Saved Results +----------------------------------------------------
spweightcs saves the following results in e():
Matrixes e(wcs) Cross Section Spatial Weight Matrix.{p_end}
+---------+ ----+ Example +----------------------------------------------------------
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 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
+---------------------+ ----+ spweightcs Citation +----------------------------------------------
Shehata, Emad Abd Elmessih (2011) SPWEIGHTCS: "Stata Module to 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:
spregcs, spregxt, spautoreg, spweight, gs3sls, gs2slsxt, spmstar, spweightcs, spweightxt, spcs2xt (if installed).