-------------------------------------------------------------------------------
help: gs3sls                                                        dialog: gs3
> sls
-------------------------------------------------------------------------------

+-------+ ----+ Title +------------------------------------------------------------

gs3sls: Generalized Spatial Autoregressive 3SLS Regression

+-------------------+ ----+ Table of Contents +------------------------------------------------

Syntax Options Other Options Description Saved Results References

*** Examples

Acknowledgments Author

+--------+ ----+ Syntax +-----------------------------------------------------------

gs3sls depvar indepvars [if] [in] [weight], wmfile(weight_file) wmat(weight_matrix_name_W) eigw(eig_var_name_eW) [ model(spgls|gs2sls|gs2slsar|gs3sls|gs3slsar) run(2sls|liml|melo|kclass|fuller|gmm) hetcov(gmm_type) stand var2(varlist) order(1, 2, 3, 4) aux(varlist) noconstant noconexog robust ols 2sls 3sls sure mvreg kf(#) kc(#) small level(#) vce( vcetype) ]

+---------+ ----+ Options +----------------------------------------------------------

options Description -------------------------------------------------------------------------

* wmfile(weight_file) weight matrix file name

* wmat(weight_matrix_name) name of the new spatial weight matrix to be used from importing wmfile(), it has two types; row-standardized, and binary weight matrix.

* eigw(eig_var_name) new eigenvalues variable name

+---------------+ ----+ Other Options +----------------------------------------------------

options Description -------------------------------------------------------------------------

model(spgls, gs2sls, gs2slsar, gs3sls, gs3slsar)

1- model(spgls) Spatial Autoregressive Generalized Least Squares [Kelejian- > Prucha(1999)]

2- model(gs2sls) Generalized Spatial 2SLS Model GS2SLS

3- model(gs2slsar) Generalized Spatial Autoregressive 2SLS Model [Kelejian- > Prucha(1998)]

4- model(gs3sls) Generalized Spatial 3SLS Model GS3SLS reg3

5- model(gs3slsar) Generalized Spatial Autoregressive 3SLS Model [Kelejian- > Prucha(2004)]

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

order(1, 2, 3, 4) order of lagged independent variables up to maximum 4th order. Default is 1. order(2,3,4) works only with: model(gs2sls, gs2slsar, gs3sls, gs3slsar)

var2(varlist) Dependent and Independent Variables for the second equation in model(gs3slsar).

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.

robust Use Huber-White standard errors.

+-------------+ ----+ RUN Options +------------------------------------------------------ run description 2sls Two-Stage Least Squares (2SLS) liml Limited-Information Maximum Likelihood (LIML) melo Minimum Expected Loss (MELO) fuller Fuller k-Class LIML kf(#) Fuller k-Class LIML Value kclass Theil k-Class LIML kc(#) Theil k-Class LIML Value gmm Generalized Method of Moments (GMM)

+-------------+ ----+ GMM Options +------------------------------------------------------ hetcov Options Description

hetcov(white) White Method hetcov(bart) Bartlett Method hetcov(dan) Daniell Method hetcov(nwest) Newey-West Method hetcov(parzen) Parzen Method hetcov(quad) Quadratic Spectral Method hetcov(tent) Tent Method hetcov(trunc) Truncated Method hetcov(tukeym) Tukey-Hamming Method hetcov(tukeyn) Tukey-Hanning Method

noconstant Exclude Constant Term from RHS Equation only

noconexog Exclude Constant Term from all Equations (both RHS and Instrumental Equations). Results of using noconexog option are identical to Stata ivregress and ivreg2. The default of gs3sls is including Constant Term in both RHS and Instrumental Equations

dn Use (N) divisor instead of (N-K) for Degrees of Freedom (DF)

ols in model(gs3sls, gs3slsar) Ordinary Least Squares (OLS)

2sls in model(gs3sls, gs3slsar) Two-Stage Least Squares (2SLS)

3sls in model(gs3sls, gs3slsar) Three-Stage Least Squares (3SLS)

sure in model(gs3sls, gs3slsar) Seemingly Unrelated Regression Estimation (SURE)

mvreg in model(gs3sls, gs3slsar) SURE with OLS DF adjustment (MVREG)

first in model(gs3sls, gs3slsar) full first-stage regression, diagnostic and identification tests will be displayed

small in model(gs2sls, gs2slsar, gs3sls, gs3slsar) Use (F and t-tests) instead of (chi-squared and z-tests)

level(#) confidence intervals level. Default is level(95)

vce(vcetype) vcetype: robust, cluster clustvar, bootstrap, jackknife, hc2, or hc3

+-------------+ ----+ Description +------------------------------------------------------

gs3sls estimate Generalized Spatial Autoregressive SPGLS, 2SLS, 3SLS Regression models for Cross Section data, and when error term has serial correlation.

gs3sls can generate: - Binary Weight Matrix. - Binary Eigenvalues Variable.

- Row-Standardized Weight Matrix. - Row-Standardized Eigenvalues Variable.

- Spatial lagged variables up to 4th order.

R2, R2 Adjusted, and F-Test, are obtained from two ways: 1- squared correlation between predicted (Yh) and observed dependent variable (Y). 2- Ratio of variance between predicted (Yh) and observed dependent variable (Y). - R2 Adjusted: R2_a=1-(1-R2)*(N-1)/(N-K-1). - F-Test=R2/(1-R2)*(N-K-1)/(K).

Log Likelihood Function (LLF), Akaike Information Criterion (AIC), and Schwarz Criterion (SC) were displayed in:

+---------------+ ----+ Saved Results +----------------------------------------------------

gs3sls saves the following results in e():

Scalars e(chi2) chi-squared e(chi2_#) chi-squared for equation # e(df_m) model degrees of freedom e(df_r) Residual degrees of freedom e(F) F statistic e(F_#) F statistic for equation # (small) e(fth) F-test due to r2h e(ftv) F-test due to r2v e(ic) number of iterations e(k) number of parameters e(ll) log likelihood e(ll_0) log likelihood for OLS e(N) number of observations e(p) significance of model of test e(p_wald) p-value for Wald test e(r2_#) R-squared for equation # e(r2_a) Adjusted R-squared e(r2c) Centered R-squared, 1-rss/yyc e(r2h) R2 between predicted and observed depvar e(r2h_a) adjusted r2h e(r2u) Uncentered R-squared, 1-rss/yy e(r2v) R2 variance ratio between predicted and observed depvar e(r2v_a) adjusted r2v e(rank) rank of e(V) e(rmse_#) root mean squared error for equation # e(rss) Residual SS e(rss_#) residual sum of squares for equation #

Macros e(depvar) Name of dependent variable e(diparm#) display transformed parameter # e(title) title in estimation output e(vce) vcetype Covariance estimation method specified in vce() e(weights) name of spatial weight matrix e(wtype) weight type

Matrixes e(b) coefficient vector e(V) variance-covariance matrix of the estimators e(Sigma) Sigma hat matrix

Functions e(sample) marks estimation sample

+------------+ ----+ References +-------------------------------------------------------

Harry H. Kelejian and Ingmar R. Prucha (1998) "A Generalized Spatial Two-Stage Least Squares Procedures for Estimating a Spatial Autoregressive Model with Autoregressive Disturbances", Journal of Real Estate Finance and Economics, (17); 99-121. http://econweb.umd.edu/~prucha/Papers/JREFE17(1998).pdf

Harry H. Kelejian and Ingmar R. Prucha (1999) "A Generalized Moments Estimator for the Autoregressive Parameter in a Spatial Model", International Economic Review, (40); 509-533. http://econweb.umd.edu/~prucha/Papers/IER40(1999).pdf

Harry H. Kelejian and Ingmar R. Prucha (2004) "Estimation of Simultaneous Systems of Spatially Interrelated Cross Sectional Equations", Journal of Econometrics, (118); 27-50. http://econweb.umd.edu/~prucha/Papers/JE118(2004).pdf

James LeSage and R. Kelly Pace (2009) "Introduction to Spatial Econometrics", Publisher: Chapman & Hall/CRC.

White, Halbert (1980) "A Heteroskedasticity-Consistent Covariance Matrix Estimator and a Direct Test for Heteroskedasticity", Econometrica, 48; 817-838.

+----------+ ----+ Examples +---------------------------------------------------------

Note1: spweight module can be used to create Cross Section Spatial Weight Matrix. Note2: You can use the dialog box for gs3sls. -------------------------------------------------------------------------------

clear all

sysuse gs3sls.dta, clear

* (1) Spatial Autoregressive Generalized Least Squares (SPGLS)

gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(spgls) -------------------------------------------------------------------------------

* (2-1) Generalized Spatial 2SLS - AR(1) (GS2SLS)

gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(2sls) order(1 > )

gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(2sls) gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(melo) gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(liml) gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(kclass) kc(0. > 5) gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(fuller) kf(0. > 5) gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(gmm) hetcov(w > hite) gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(gmm) hetcov(b > art) gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(gmm) hetcov(d > an) gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(gmm) hetcov(n > west) gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(gmm) hetcov(p > arzen) gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(gmm) hetcov(q > uad) gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(gmm) hetcov(t > ent) gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(gmm) hetcov(t > runc) gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(gmm) hetcov(t > ukeym) gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(gmm) hetcov(t > ukeyn) -------------------------------------------------------------------------------

* (2-2) Generalized Spatial 2SLS - AR(2) (GS2SLS) gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(2sls) order(2 > ) -------------------------------------------------------------------------------

* (2-3) Generalized Spatial 2SLS - AR(3) (GS2SLS) gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(2sls) order(3 > ) -------------------------------------------------------------------------------

* (2-4) Generalized Spatial 2SLS - AR(4) (GS2SLS) gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(2sls) order(4 > ) -------------------------------------------------------------------------------

* (3-1) Generalized Spatial Autoregressive 2SLS - AR(1) (GS2SLSAR) gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(2sls) order(1 > ) -------------------------------------------------------------------------------

* (3-2) Generalized Spatial Autoregressive 2SLS - AR(2) (GS2SLSAR) gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(2sls) order(2 > ) -------------------------------------------------------------------------------

* (3-3) Generalized Spatial Autoregressive 2SLS - AR(3) (GS2SLSAR) gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(2sls) order(3 > ) -------------------------------------------------------------------------------

* (3-4) Generalized Spatial Autoregressive 2SLS - AR(4) (GS2SLSAR) gs3sls y x1 x2 , wmfile(SPWcs) wmat(W) eigw(eW) model(gs2sls) run(2sls) order(4 > ) -------------------------------------------------------------------------------

* (4-2) Generalized Spatial 3SLS - AR(2) (GS3SLS) gs3sls y x1 x2 , var2(y2 x2) wmfile(SPWcs) wmat(W) eigw(eW) model(gs3sls) order > (2) -------------------------------------------------------------------------------

* (4-3) Generalized Spatial 3SLS - AR(3) (GS3SLS) gs3sls y x1 x2 , var2(y2 x2) wmfile(SPWcs) wmat(W) eigw(eW) model(gs3sls) order > (3) -------------------------------------------------------------------------------

* (4-4) Generalized Spatial 3SLS - AR(4) (GS3SLS) gs3sls y x1 x2 , var2(y2 x2) wmfile(SPWcs) wmat(W) eigw(eW) model(gs3sls) order > (4) -------------------------------------------------------------------------------

* (5-2) Generalized Spatial Autoregressive 3SLS - AR(2) (GS3SLSAR) gs3sls y1 x1 x2 , var2(y2 x2) wmfile(SPWcs) wmat(W) eigw(eW) model(gs3slsar) or > der(2) -------------------------------------------------------------------------------

* (5-3) Generalized Spatial Autoregressive 3SLS - AR(3) (GS3SLSAR) gs3sls y1 x1 x2 , var2(y2 x2) wmfile(SPWcs) wmat(W) eigw(eW) model(gs3slsar) or > der(3) -------------------------------------------------------------------------------

* (5-4) Generalized Spatial Autoregressive 3SLS - AR(4) (GS3SLSAR) gs3sls y1 x1 x2 , var2(y2 x2) wmfile(SPWcs) wmat(W) eigw(eW) model(gs3slsar) or > der(4) -------------------------------------------------------------------------------

* (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 Mo > del More details can be found in: http://econweb.umd.edu/~prucha/Research_Prog1.ht > m Results of model(spgls) is identical to: http://econweb.umd.edu/~prucha/STATPROG/OLS/PROGRAM1.log

clear all sysuse gs3sls1.dta , clear gs3sls y x1 , wmfile(SPWcs1) wmat(W) eigw(eW) model(spgls) -------------------------------------------------------------------------------

* (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: http://econweb.umd.edu/~prucha/Research_Prog2.ht > m Results of model(gs2slsar) with order(2) is identical to: http://econweb.umd.edu/~prucha/STATPROG/2SLS/PROGRAM2.log

clear all sysuse gs3sls2.dta , clear gs3sls y x1 , wmfile(SPWcs2) wmat(W) eigw(eW) model(gs2slsar) run(2sls) > order(2) -------------------------------------------------------------------------------

* (5) Generalized Spatial Autoregressive 3SLS (GS3SLSAR) (Cont.) This example is taken from Prucha data about: Estimation of Simultaneous Systems of Spatially Interrelated Cross Sectional E > quations More details can be found in: http://econweb.umd.edu/~prucha/Research_Prog4.ht > m Results of model(gs3slsar) with order(2) is identical to: http://econweb.umd.edu/~prucha/STATPROG/SIMEQU/PROGRAM4.log

clear all sysuse gs3sls3.dta , clear gs3sls y1 x1 , var2(y2 x2) wmfile(SPWcs3) wmat(W) eigw(eW) model(gs3sls > ar) order(2) -------------------------------------------------------------------------------

+-----------------+ ----+ Acknowledgments +--------------------------------------------------

I would like to thank professor Ingmar Prucha.

+--------+ ----+ 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

+-----------------+ ----+ gs3sls Citation +--------------------------------------------------

Shehata, Emad Abd Elmessih (2011) GS3SLS: "Stata Module to Estimate Generalized Spatial Autoregressive 3SLS Regression"

Online Help:

gs3sls, gs2slsxt, spregxt, spautoreg, spmstar, spweight, spweigcs, spweightxt, spcs2xt, spreg, spivreg, spatreg, spmlreg. (if installed).