{smcl} {hline} {cmd:help: {helpb gs3sls}}{space 55} {cmd:dialog:} {bf:{dialog gs3sls}} {hline} {bf:{err:{dlgtab:Title}}} {bf:gs3sls: Generalized Spatial Autoregressive 3SLS Regression} {marker 00}{bf:{err:{dlgtab:Table of Contents}}} {p 4 8 2} {p 5}{helpb gs3sls##01:Syntax}{p_end} {p 5}{helpb gs3sls##02:Options}{p_end} {p 5}{helpb gs3sls##03:Other Options}{p_end} {p 5}{helpb gs3sls##04:Description}{p_end} {p 5}{helpb gs3sls##05:Saved Results}{p_end} {p 5}{helpb gs3sls##06:References}{p_end} {p 1}*** {helpb gs3sls##07:Examples}{p_end} {p 5}{helpb gs3sls##08:Acknowledgments}{p_end} {p 5}{helpb gs3sls##09:Author}{p_end} {p2colreset}{...} {marker 01}{bf:{err:{dlgtab:Syntax}}} {p 4 8 6} {opt gs3sls} {depvar} {indepvars} {ifin} {weight}, {opt wmf:ile(weight_file)}{p_end} {p 12 8 8} {opt wmat(weight_matrix_name_W)} {opt eigw(eig_var_name_eW)}{p_end} {p 4 8 6} {err: [} {opt m:odel(spgls|gs2sls|gs2slsar|gs3sls|gs3slsar)}{p_end} {p 8 8 6} {opt run(2sls|liml|melo|kclass|fuller|gmm)} {opt hetc:ov(gmm_type)}{p_end} {p 8 8 6} {opt stand} {opt var2(varlist)} {opt ord:er(1, 2, 3, 4)} {opt aux(varlist)} {opt nocons:tant} {opt noconexog}{p_end} {p 8 8 6} {opt robust} {opt ols} {opt 2sls} {opt 3sls} {opt sure} {opt mvreg} {opt kf(#)} {opt kc(#)} {opt small} {opt l:evel(#)} {opth vce(vcetype)} {err:]}{p_end} {p2colreset}{...} {marker 02}{bf:{err:{dlgtab:Options}}} {p 2 10 2} {synoptset 10 tabbed}{...} {synopthdr} {synoptline} {synopt :{err:*} {opt wmf:ile(weight_file)}}weight matrix file name{p_end} {synopt :{err:*} {opt wmat(weight_matrix_name)}}name of the new spatial weight matrix to be used from importing {cmd:wmfile()}, it has two types; row-standardized, and binary weight matrix.{p_end} {synopt :{err:*} {opt eigw(eig_var_name)}}new eigenvalues variable name{p_end} {p2colreset}{...} {marker 03}{bf:{err:{dlgtab:Other Options}}} {p 2 10 2} {synoptset 3 tabbed}{...} {synopthdr} {synoptline} {synopt :{opt m:odel(spgls, gs2sls, gs2slsar, gs3sls, gs3slsar)}}{p_end} {cmd:1- {opt model(spgls)} Spatial Autoregressive Generalized Least Squares} [Kelejian-Prucha(1999)] {cmd:2- {opt model(gs2sls)} Generalized Spatial 2SLS Model GS2SLS} {cmd:3- {opt model(gs2slsar)} Generalized Spatial Autoregressive 2SLS Model} [Kelejian-Prucha(1998)] {cmd:4- {opt model(gs3sls)} Generalized Spatial 3SLS Model GS3SLS} {help reg3} {cmd:5- {opt model(gs3slsar)} Generalized Spatial Autoregressive 3SLS Model} [Kelejian-Prucha(2004)] {synopt :{opt stand}}new row-standardized weight matrix within each row sum equals 1. Default is Binary spatial weight matrix which each element is 0 or 1{p_end} {synopt :{opt order(1, 2, 3, 4)}}order of lagged independent variables up to maximum 4th order. Default is 1. {bf:order(2,3,4)} works only with: {bf:model({err:{it:gs2sls, gs2slsar, gs3sls, gs3slsar}})}{p_end} {synopt :{opt var2(varlist)}}Dependent and Independent Variables for the second equation in {bf:model({err:{it:gs3slsar}})}.{p_end} {synopt :{opt aux(varlist)}}add Auxiliary Variables into regression model, i.e., dummy variables. This option dont include these auxiliary variables among spatial lagged variables. Using many dummy variables must be used with caution to avoid multicollinearity problem, that results singular matrix, and lead to abort estimation.{p_end} {synopt :{opt robust}}Use Huber-White standard errors.{p_end} {bf:{err:{dlgtab:RUN Options}}} {synoptset 16}{...} {p2coldent:{it:run}}description{p_end} {synopt:{opt 2sls}}Two-Stage Least Squares (2SLS){p_end} {synopt:{opt liml}}Limited-Information Maximum Likelihood (LIML){p_end} {synopt:{opt melo}}Minimum Expected Loss (MELO){p_end} {synopt:{opt fuller}}Fuller k-Class LIML{p_end} {bf:kf({err:{it:#}})} Fuller k-Class LIML Value {synopt:{opt kclass}}Theil k-Class LIML{p_end} {bf:kc({err:{it:#}})} Theil k-Class LIML Value {synopt:{opt gmm}}Generalized Method of Moments (GMM){p_end} {bf:{err:{dlgtab:GMM Options}}} {synoptset 16}{...} {p2coldent:{it:hetcov Options}}Description{p_end} {synopt:{bf:hetcov({err:{it:white}})}}White Method{p_end} {synopt:{bf:hetcov({err:{it:bart}})}}Bartlett Method{p_end} {synopt:{bf:hetcov({err:{it:dan}})}}Daniell Method{p_end} {synopt:{bf:hetcov({err:{it:nwest}})}}Newey-West Method{p_end} {synopt:{bf:hetcov({err:{it:parzen}})}}Parzen Method{p_end} {synopt:{bf:hetcov({err:{it:quad}})}}Quadratic Spectral Method{p_end} {synopt:{bf:hetcov({err:{it:tent}})}}Tent Method{p_end} {synopt:{bf:hetcov({err:{it:trunc}})}}Truncated Method{p_end} {synopt:{bf:hetcov({err:{it:tukeym}})}}Tukey-Hamming Method{p_end} {synopt:{bf:hetcov({err:{it:tukeyn}})}}Tukey-Hanning Method{p_end} {synopt:{opt nocons:tant}}Exclude Constant Term from RHS Equation only{p_end} {synopt:{opt noconexog}}Exclude Constant Term from all Equations (both RHS and Instrumental Equations). Results of using {cmd:noconexog} option are identical to Stata {helpb ivregress} and {helpb ivreg2}. The default of {cmd:gs3sls} is including Constant Term in both RHS and Instrumental Equations{p_end} {synopt:{bf:dn}}Use (N) divisor instead of (N-K) for Degrees of Freedom (DF){p_end} {synopt :{opt ols}}in {opt model(gs3sls, gs3slsar)} Ordinary Least Squares (OLS){p_end} {synopt :{opt 2sls}}in {opt model(gs3sls, gs3slsar)} Two-Stage Least Squares (2SLS){p_end} {synopt :{opt 3sls}}in {opt model(gs3sls, gs3slsar)} Three-Stage Least Squares (3SLS){p_end} {synopt :{opt sure}}in {opt model(gs3sls, gs3slsar)} Seemingly Unrelated Regression Estimation (SURE){p_end} {synopt :{opt mvreg}}in {opt model(gs3sls, gs3slsar)} SURE with OLS DF adjustment (MVREG){p_end} {synopt :{opt first}}in {opt model(gs3sls, gs3slsar)} full first-stage regression, diagnostic and identification tests will be displayed{p_end} {synopt :{opt small}}in {opt model(gs2sls, gs2slsar, gs3sls, gs3slsar)} Use (F and t-tests) instead of (chi-squared and z-tests){p_end} {synopt :{opt level(#)}}confidence intervals level. Default is level(95){p_end} {synopt :{opth vce(vcetype)}}{it:vcetype}: {opt r:obust}, {opt cl:uster} {it:clustvar}, {opt boot:strap}, {opt jack:knife}, {opt hc2}, or {opt hc3}{p_end} {p2colreset}{...} {marker 04}{bf:{err:{dlgtab:Description}}} {p 2 2 2} {cmd:gs3sls} estimate Generalized Spatial Autoregressive SPGLS, 2SLS, 3SLS Regression models for Cross Section data, and when error term has serial correlation.{p_end} {p 2 4 2}{cmd:gs3sls} can generate:{p_end} {cmd:- Binary Weight Matrix.} {cmd:- Binary Eigenvalues Variable.} {cmd:- Row-Standardized Weight Matrix.} {cmd:- Row-Standardized Eigenvalues Variable.} {cmd:- Spatial lagged variables up to 4th order.} {p 3 4 2} R2, R2 Adjusted, and F-Test, are obtained from two ways:{p_end} {p 5 4 2} 1- squared correlation between predicted (Yh) and observed dependent variable (Y).{p_end} {p 5 4 2} 2- Ratio of variance between predicted (Yh) and observed dependent variable (Y).{p_end} {p 5 4 2} - R2 Adjusted: R2_a=1-(1-R2)*(N-1)/(N-K-1).{p_end} {p 5 4 2} - F-Test=R2/(1-R2)*(N-K-1)/(K).{p_end} {p 2 4 2} Log Likelihood Function (LLF), Akaike Information Criterion (AIC), and Schwarz Criterion (SC) were displayed in:{p_end} {p2colreset}{...} {marker 05}{bf:{err:{dlgtab:Saved Results}}} {p 2 4 2 }{cmd:gs3sls} saves the following results in {cmd:e()}: Scalars {col 4}{cmd:e(chi2)}{col 22}chi-squared {col 4}{cmd:e(chi2_}{it:#}{cmd:)}{col 22}chi-squared for equation {it:#} {col 4}{cmd:e(df_m)}{col 22}model degrees of freedom {col 4}{cmd:e(df_r)}{col 22}Residual degrees of freedom {col 4}{cmd:e(F)}{col 22}F statistic {col 4}{cmd:e(F_}{it:#}{cmd:)}{col 22}F statistic for equation {it:#} ({cmd:small}) {col 4}{cmd:e(fth)}{col 22}F-test due to r2h {col 4}{cmd:e(ftv)}{col 22}F-test due to r2v {col 4}{cmd:e(ic)}{col 22}number of iterations {col 4}{cmd:e(k)}{col 22}number of parameters {col 4}{cmd:e(ll)}{col 22}log likelihood {col 4}{cmd:e(ll_0)}{col 22}log likelihood for OLS {col 4}{cmd:e(N)}{col 22}number of observations {col 4}{cmd:e(p)}{col 22}significance of model of test {col 4}{cmd:e(p_wald)}{col 22}p-value for Wald test {col 4}{cmd:e(r2_}{it:#}{cmd:)}{col 22}R-squared for equation {it:#} {col 4}{cmd:e(r2_a)}{col 22}Adjusted R-squared {col 4}{cmd:e(r2c)}{col 22}Centered R-squared, 1-rss/yyc {col 4}{cmd:e(r2h)}{col 22}R2 between predicted and observed depvar {col 4}{cmd:e(r2h_a)}{col 22}adjusted r2h {col 4}{cmd:e(r2u)}{col 22}Uncentered R-squared, 1-rss/yy {col 4}{cmd:e(r2v)}{col 22}R2 variance ratio between predicted and observed depvar {col 4}{cmd:e(r2v_a)}{col 22}adjusted r2v {col 4}{cmd:e(rank)}{col 22}rank of e(V) {col 4}{cmd:e(rmse_}{it:#}{cmd:)}{col 22}root mean squared error for equation {it:#} {col 4}{cmd:e(rss)}{col 22}Residual SS {col 4}{cmd:e(rss_}{it:#}{cmd:)}{col 22}residual sum of squares for equation {it:#} Macros {col 4}{cmd:e(depvar)}{col 22}Name of dependent variable {col 4}{cmd:e(diparm}{it:#}{cmd:)}{col 22}display transformed parameter {it:#} {col 4}{cmd:e(title)}{col 22}title in estimation output {col 4}{cmd:e(vce)}{col 22}{it:vcetype} Covariance estimation method specified in {cmd:vce()} {col 4}{cmd:e(weights)}{col 22}name of spatial weight matrix {col 4}{cmd:e(wtype)}{col 22}weight type Matrixes {col 4}{cmd:e(b)}{col 22}coefficient vector {col 4}{cmd:e(V)}{col 22}variance-covariance matrix of the estimators {col 4}{cmd:e(Sigma)}{col 22}Sigma hat matrix Functions {col 4}{cmd:e(sample)}{col 22}marks estimation sample {marker 06}{bf:{err:{dlgtab:References}}} {p 4 8 2}Harry H. Kelejian and Ingmar R. Prucha (1998) {cmd: "A Generalized Spatial Two-Stage Least Squares Procedures for Estimating a Spatial Autoregressive Model with Autoregressive Disturbances",} {it:Journal of Real Estate Finance and Economics, (17)}; 99-121. {browse "http://econweb.umd.edu/~prucha/Papers/JREFE17(1998).pdf"} {p 4 8 2}Harry H. Kelejian and Ingmar R. Prucha (1999) {cmd: "A Generalized Moments Estimator for the Autoregressive Parameter in a Spatial Model",} {it:International Economic Review, (40)}; 509-533. {browse "http://econweb.umd.edu/~prucha/Papers/IER40(1999).pdf"} {p 4 8 2}Harry H. Kelejian and Ingmar R. Prucha (2004) {cmd: "Estimation of Simultaneous Systems of Spatially Interrelated Cross Sectional Equations",} {it:Journal of Econometrics, (118)}; 27-50. {browse "http://econweb.umd.edu/~prucha/Papers/JE118(2004).pdf"} {p 4 8 2}James LeSage and R. Kelly Pace (2009) {cmd: "Introduction to Spatial Econometrics",} {it:Publisher: Chapman & Hall/CRC}. {p 4 8 2}White, Halbert (1980) {cmd: "A Heteroskedasticity-Consistent Covariance Matrix Estimator and a Direct Test for Heteroskedasticity",} {it:Econometrica, 48}; 817-838. {p2colreset}{...} {marker 07}{bf:{err:{dlgtab:Examples}}} {p 2 2 2}{bf:Note1:} {helpb spweight} module can be used to create Cross Section Spatial Weight Matrix.{p_end} {p 2 2 2}{bf:Note2:} You can use the dialog box for {dialog gs3sls}.{p_end} {hline} {stata clear all} {stata sysuse gs3sls.dta, clear} {bf:{err:* (1) Spatial Autoregressive Generalized Least Squares (SPGLS)}} {stata gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(spgls)} {hline} {bf:{err:* (2-1) Generalized Spatial 2SLS - AR(1) (GS2SLS)}} {stata gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(2sls) order(1)} {stata gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(2sls)} {stata gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(melo)} {stata gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(liml)} {stata gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(kclass) kc(0.5)} {stata gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(fuller) kf(0.5)} {stata gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(gmm) hetcov(white)} {stata gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(gmm) hetcov(bart)} {stata gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(gmm) hetcov(dan)} {stata gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(gmm) hetcov(nwest)} {stata gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(gmm) hetcov(parzen)} {stata gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(gmm) hetcov(quad)} {stata gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(gmm) hetcov(tent)} {stata gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(gmm) hetcov(trunc)} {stata gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(gmm) hetcov(tukeym)} {stata gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(gmm) hetcov(tukeyn)} {hline} {bf:{err:* (2-2) Generalized Spatial 2SLS - AR(2) (GS2SLS)}} {stata gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(2sls) order(2)} {hline} {bf:{err:* (2-3) Generalized Spatial 2SLS - AR(3) (GS2SLS)}} {stata gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(2sls) order(3)} {hline} {bf:{err:* (2-4) Generalized Spatial 2SLS - AR(4) (GS2SLS)}} {stata gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(2sls) order(4)} {hline} {bf:{err:* (3-1) Generalized Spatial Autoregressive 2SLS - AR(1) (GS2SLSAR)}} {stata gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(2sls) order(1)} {hline} {bf:{err:* (3-2) Generalized Spatial Autoregressive 2SLS - AR(2) (GS2SLSAR)}} {stata gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(2sls) order(2)} {hline} {bf:{err:* (3-3) Generalized Spatial Autoregressive 2SLS - AR(3) (GS2SLSAR)}} {stata gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(2sls) order(3)} {hline} {bf:{err:* (3-4) Generalized Spatial Autoregressive 2SLS - AR(4) (GS2SLSAR)}} {stata gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(2sls) order(4)} {hline} {bf:{err:* (4-2) Generalized Spatial 3SLS - AR(2) (GS3SLS)}} {stata gs3sls y x1 x2 , var2(y2 x2) wmfile(SPWcs) wmat(W) eigw(eW) model(gs3sls) order(2)} {hline} {bf:{err:* (4-3) Generalized Spatial 3SLS - AR(3) (GS3SLS)}} {stata gs3sls y x1 x2 , var2(y2 x2) wmfile(SPWcs) wmat(W) eigw(eW) model(gs3sls) order(3)} {hline} {bf:{err:* (4-4) Generalized Spatial 3SLS - AR(4) (GS3SLS)}} {stata gs3sls y x1 x2 , var2(y2 x2) wmfile(SPWcs) wmat(W) eigw(eW) model(gs3sls) order(4)} {hline} {bf:{err:* (5-2) Generalized Spatial Autoregressive 3SLS - AR(2) (GS3SLSAR)}} {stata gs3sls y1 x1 x2 , var2(y2 x2) wmfile(SPWcs) wmat(W) eigw(eW) model(gs3slsar) order(2)} {hline} {bf:{err:* (5-3) Generalized Spatial Autoregressive 3SLS - AR(3) (GS3SLSAR)}} {stata gs3sls y1 x1 x2 , var2(y2 x2) wmfile(SPWcs) wmat(W) eigw(eW) model(gs3slsar) order(3)} {hline} {bf:{err:* (5-4) Generalized Spatial Autoregressive 3SLS - AR(4) (GS3SLSAR)}} {stata gs3sls y1 x1 x2 , var2(y2 x2) wmfile(SPWcs) wmat(W) eigw(eW) model(gs3slsar) order(4)} {hline} {bf:{err:* (1) Spatial Autoregressive Generalized Least Squares (SPGLS)} (Cont.)} This example is taken from Prucha data about: Generalized Moments Estimator for the Autoregressive Parameter in a Spatial Model More details can be found in: {browse "http://econweb.umd.edu/~prucha/Research_Prog1.htm"} Results of {bf:model({err:{it:spgls}})} is identical to: {browse "http://econweb.umd.edu/~prucha/STATPROG/OLS/PROGRAM1.log"} {stata clear all} {stata sysuse gs3sls1.dta , clear} {stata gs3sls y x1 , wmfile(SPWcs1) wmat(W) eigw(eW) model(spgls)} {hline} {bf:{err:* (3) Generalized Spatial Autoregressive 2SLS (GS2SLSAR)} (Cont.)} This example is taken from Prucha data about: Generalized Spatial Two-Stage Least Squares Procedures for Estimating a Spatial Autoregressive Model with Autoregressive Disturbances More details can be found in: {browse "http://econweb.umd.edu/~prucha/Research_Prog2.htm"} Results of {bf:model({err:{it:gs2slsar}})} with order(2) is identical to: {browse "http://econweb.umd.edu/~prucha/STATPROG/2SLS/PROGRAM2.log"} {stata clear all} {stata sysuse gs3sls2.dta , clear} {stata gs3sls y x1 , wmfile(SPWcs2) wmat(W) eigw(eW) model(gs2slsar) run(2sls) order(2)} {hline} {bf:{err:* (5) Generalized Spatial Autoregressive 3SLS (GS3SLSAR)} (Cont.)} This example is taken from Prucha data about: Estimation of Simultaneous Systems of Spatially Interrelated Cross Sectional Equations More details can be found in: {browse "http://econweb.umd.edu/~prucha/Research_Prog4.htm"} Results of {bf:model({err:{it:gs3slsar}})} with order(2) is identical to: {browse "http://econweb.umd.edu/~prucha/STATPROG/SIMEQU/PROGRAM4.log"} {stata clear all} {stata sysuse gs3sls3.dta , clear} {stata gs3sls y1 x1 , var2(y2 x2) wmfile(SPWcs3) wmat(W) eigw(eW) model(gs3slsar) order(2)} {hline} {p2colreset}{...} {marker 08}{bf:{err:{dlgtab:Acknowledgments}}} I would like to thank professor Ingmar Prucha. {marker 09}{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:gs3sls Citation}}} {phang}Shehata, Emad Abd Elmessih (2011){p_end} {phang}{cmd:GS3SLS: "Stata Module to Estimate Generalized Spatial Autoregressive 3SLS Regression"}{p_end} {title:Online Help:} {p 4 12 2}{helpb gs3sls}, {helpb gs2slsxt}, {helpb spregxt}, {helpb spautoreg}, {helpb spmstar}, {helpb spweight}, {helpb spweigcs}, {helpb spweightxt}, {helpb spcs2xt}, {helpb spreg}, {helpb spivreg}, {helpb spatreg}, {helpb spmlreg}. {opt (if installed)}.{p_end} {psee} {p_end}