{smcl} {hline} {cmd:help: {helpb spcs2xt}}{space 55} {cmd:dialog:} {bf:{dialog spcs2xt}} {hline} {bf:{err:{dlgtab:Title}}} {bf: spcs2xt: Convert Squared Cross Section to Panel Spatial Weight Matrix} {bf:{err:{dlgtab:Syntax}}} {phang} {cmd: spcs2xt} {varlist} {cmd:,} {opt p:anel(numlist)} {opt t:ime(numlist)} {opt m:atrix(new_panel_weight_file)} {bf:{err:{dlgtab:Description}}} {p 2 2 2} {cmd: spcs2xt} creates or generates squared panel spatial weight matrix and file among neighbor locations, from squared Cross Section weight matrix, that already exists in stata dta file, for using in panel spatial regression analysis.{p_end} {bf:{err:{dlgtab:Options}}} {p 2 2 2}{cmd: time}: Number of time series in each cross section (must be balanced).{p_end} {p 2 2 2}{cmd: matrix}: Specify name of new panel spatial weight matrix file as stata dta file, that will be created.{p_end} {bf:{err:{dlgtab:Examples}}} {stata clear all} {stata use spcs2xt.dta, clear} {stata db spcs2xt} {stata spcs2xt v1 v2 v3 v4, time(4) matrix(W)} {cmd:OR USE} {stata spcs2xt v*, time(4) matrix(W)} {stata mat list W} {stata mat list Wxt} {p 2 2 2} The final shape of cross section and panel spatial weight matrix will be as follows:.{p_end} -------------------------- | {bf:1} {bf:2} {bf:3} {bf:4} |------------------------- | 0 {bf:{red:1}} {bf:{red:1}} {bf:{red:1}} | {bf:{red:1}} 0 {bf:{red:1}} 0 | {bf:{red:1}} {bf:{red:1}} 0 {bf:{red:1}} | {bf:{red:1}} 0 {bf:{red:1}} 0 |------------------------- (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} {opt (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:spcs2xt Citation}}} {phang}Shehata, Emad Abd Elmessih (2011){p_end} {phang}{cmd: "SPCS2XT: Stata Module to Convert Squared Cross Section to Panel Spatial Weight Matrix"}{p_end} {browse "http://ideas.repec.org/c/boc/bocode/s457348.html"} {browse "http://econpapers.repec.org/software/bocbocode/s457348.htm"} {title:Also see} {p 4 12 2}Online: {helpb spautoreg}, {helpb spautoregxt}, {helpb spweight}, {helpb spweightxt}, {helpb spreg}, {helpb spivreg}, {helpb ivreg2}, {helpb spwmat}, {helpb spcs2xt}, {opt (if installed)}.{p_end} {psee} {p_end}