{smcl} {hline} {cmd:help: {helpb spweightcs}}{space 55} {cmd:dialog:} {bf:{dialog spweightcs}} {hline} {bf:{err:{dlgtab:Title}}} {bf: spweightcs: Cross Section Spatial Weight Matrix} {bf:{err:{dlgtab:Syntax}}} {phang} {cmd: spweightcs} {varlist} {cmd:,} {opt p:anel(numlist)} {opt m:atrix(weight_name)} {opt not:abel} {bf:{err:{dlgtab:Description}}} {p 2 2 2} spweightcs creates or generates cross section spatial weight matrix among neighbor locations, for using in spatial regression analysis.{p_end} {p 2 2 2} Raw data for neighbor locations must be put as shown in the sample data file {cmd: (spweightcs.dta)}.{p_end} {p2colreset}{...} {bf:{err:{dlgtab:Options}}} {col 4}{opt p:anel}{col 15}Number of all locations units {col 4}{opt m:atrix}{col 15}Specify name of spatial weight matrix, that will be created {col 4}{opt tab:le}{col 15}Display Cross Section Spatial Weight Matrix Table {bf:{err:{dlgtab:Saved Results}}} {p 2 4 2 }{cmd:spweightcs} saves the following results in {cmd:e()}: Matrixes {col 4}{cmd:e(wcs)}{col 15}Cross Section Spatial Weight Matrix.{p_end} {bf:{err:{dlgtab:Example}}} {stata clear all} {stata sysuse spweightcs.dta, clear} {stata spweightcs v1 v2 , panel(7) matrix(W)} {stata spweightcs v1 v2 , panel(7) matrix(W) table} {stata ereturn list} {stata db spweightcs} {p 2 2 2} The final shape of cross section spatial weight matrix will be as follows:.{p_end} ------------------------------------- | # | 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 | ------------------------------------- {p 2 2 2} After creating spatial weight matrix, you can use {helpb spautoreg} (if installed) to generate eigenvalues vector and standardized weight matrix.{p_end} {bf:{err:{dlgtab:Author}}} {hi:Emad Abd Elmessih Shehata} {hi:Assistant Professor} {hi:Agricultural Research Center - Agricultural Economics Research Institute - Egypt} {hi:Email: {browse "mailto:emadstat@hotmail.com":emadstat@hotmail.com}} {hi:WebPage:{col 27}{browse "http://emadstat.110mb.com/stata.htm"}} {hi:WebPage at IDEAS:{col 27}{browse "http://ideas.repec.org/f/psh494.html"}} {hi:WebPage at EconPapers:{col 27}{browse "http://econpapers.repec.org/RAS/psh494.htm"}} {bf:{err:{dlgtab:spweightcs Citation}}} {phang}Shehata, Emad Abd Elmessih (2011){p_end} {phang}{cmd:SPWEIGHTCS: "Stata Module to Create Cross Section Spatial Weight Matrix"}{p_end} {browse "http://ideas.repec.org/c/boc/bocode/s457325.html"} {browse "http://econpapers.repec.org/software/bocbocode/s457325.htm"} {title:Online Help:} {p 4 12 2} {helpb spregcs}, {helpb spregxt}, {helpb spautoreg}, {helpb spweight}, {helpb gs3sls}, {helpb gs2slsxt}, {helpb spmstar}, {helpb spweightcs}, {helpb spweightxt}, {helpb spcs2xt} {opt (if installed)}.{p_end} {psee} {p_end}