{smcl} {hline} {cmd:help: {helpb spweightxt}}{space 55} {cmd:dialog:} {bf:{dialog spweightxt}} {hline} {bf:{err:{dlgtab:Title}}} {bf: spweightxt: Panel Spatial Weight Matrix} {bf:{err:{dlgtab:Syntax}}} {cmd: spweightxt} {varlist} {cmd:,} {opt p:anel(numlist)} {opt t:ime(numlist)} {opt m:atrix(weight_name)} {opt tab:el} {opt ptab:el} {bf:{err:{dlgtab:Description}}} {p 2 2 2} spweightxt creates or generates both Cross Section and Panel Spatial Weight Matrix among neighbor locations, for using in panel spatial regression analysis.{p_end} {p 2 2 2} Raw data for neighbor locations units must be put as shown in the sample data file {cmd: (spweightxt.dta)}.{p_end} {p2colreset}{...} {bf:{err:{dlgtab:Options}}} {col 4}{opt p:anel}{col 15}Number of all locations units {col 4}{opt t:ime}{col 15}Number of time series in each cross section (must be balanced) {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 {col 4}{opt ptab:le}{col 15}Display Panel Spatial Weight Matrix Table {bf:{err:{dlgtab:Saved Results}}} {p 2 4 2 }{cmd:spweightxt} saves the following results in {cmd:e()}: Matrixes {col 4}{cmd:e(wcs)}{col 15}Cross Section Spatial Weight Matrix.{p_end} {col 4}{cmd:e(wxt)}{col 15}Panel Spatial Weight Matrix.{p_end} {bf:{err:{dlgtab:Example}}} {stata clear all} {stata sysuse spweightxt.dta, clear} {stata spweightxt v1 v2 , panel(4) time(4) matrix(W)} {stata spweightxt v1 v2 , panel(4) time(4) matrix(W) table} {stata spweightxt v1 v2 , panel(4) time(4) matrix(W) ptable} {stata spweightxt v1 v2 , panel(4) time(4) matrix(W) table ptable} {stata ereturn list} {stata db spweightxt} {p 2 2 2} The final shape of cross section and panel spatial weight matrix will be as follows:.{p_end} ----------------------------------------- | {bf:v2} {bf:v1} | {bf:1} {bf:2} {bf:3} {bf:4} {bf:Total} ------+---------------------------------- {bf:1} | 0 {bf:{red:1}} {bf:{red:1}} {bf:{red:1}} {bf:3} {bf:2} | {bf:{red:1}} 0 {bf:{red:1}} 0 {bf:2} {bf:3} | {bf:{red:1}} {bf:{red:1}} 0 {bf:{red:1}} {bf:3} {bf:4} | {bf:{red:1}} 0 {bf:{red:1}} 0 {bf:2} ------+---------------------------------- {bf:Total} | {bf:3} {bf:2} {bf:3} {bf:2} {bf:10} ----------------------------------------- (1) (2) (3) (4) |-----------------|-----------------|-----------------|-----------------| (1) | 0 0 0 0 | {bf:{red:1}} 0 0 0 | {bf:{red:1}} 0 0 0 | {bf:{red:1}} 0 0 0 | | 0 0 0 0 | 0 {bf:{red:1}} 0 0 | 0 {bf:{red:1}} 0 0 | 0 {bf:{red:1}} 0 0 | | 0 0 0 0 | 0 0 {bf:{red:1}} 0 | 0 0 {bf:{red:1}} 0 | 0 0 {bf:{red:1}} 0 | | 0 0 0 0 | 0 0 0 {bf:{red:1}} | 0 0 0 {bf:{red:1}} | 0 0 0 {bf:{red:1}} | |-----------------|-----------------|-----------------|-----------------| (2) | {bf:{red:1}} 0 0 0 | 0 0 0 0 | {bf:{red:1}} 0 0 0 | 0 0 0 0 | | 0 {bf:{red:1}} 0 0 | 0 0 0 0 | 0 {bf:{red:1}} 0 0 | 0 0 0 0 | | 0 0 {bf:{red:1}} 0 | 0 0 0 0 | 0 0 {bf:{red:1}} 0 | 0 0 0 0 | | 0 0 0 {bf:{red:1}} | 0 0 0 0 | 0 0 0 {bf:{red:1}} | 0 0 0 0 | |-----------------|-----------------|-----------------|-----------------| (3) | {bf:{red:1}} 0 0 0 | {bf:{red:1}} 0 0 0 | 0 0 0 0 | {bf:{red:1}} 0 0 0 | | 0 {bf:{red:1}} 0 0 | 0 {bf:{red:1}} 0 0 | 0 0 0 0 | 0 {bf:{red:1}} 0 0 | | 0 0 {bf:{red:1}} 0 | 0 0 {bf:{red:1}} 0 | 0 0 0 0 | 0 0 {bf:{red:1}} 0 | | 0 0 0 {bf:{red:1}} | 0 0 0 {bf:{red:1}} | 0 0 0 0 | 0 0 0 {bf:{red:1}} | |-----------------|-----------------|-----------------|-----------------| (4) | {bf:{red:1}} 0 0 0 | 0 0 0 0 | {bf:{red:1}} 0 0 0 | 0 0 0 0 | | 0 {bf:{red:1}} 0 0 | 0 0 0 0 | 0 {bf:{red:1}} 0 0 | 0 0 0 0 | | 0 0 {bf:{red:1}} 0 | 0 0 0 0 | 0 0 {bf:{red:1}} 0 | 0 0 0 0 | | 0 0 0 {bf:{red:1}} | 0 0 0 0 | 0 0 0 {bf:{red:1}} | 0 0 0 0 | |-----------------|-----------------|-----------------|------------------ {p 2 2 2} After creating panel 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:spweightxt Citation}}} {phang}Shehata, Emad Abd Elmessih (2011){p_end} {phang}{cmd:SPWEIGHTXT: "Stata Module to Create Panel Spatial Weight Matrix"}{p_end} {browse "http://ideas.repec.org/c/boc/bocode/s457330.html"} {browse "http://econpapers.repec.org/software/bocbocode/s457330.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}