-------------------------------------------------------------------------------
help: gs2slsxt                                                        dialog: g
> s2slsxt
-------------------------------------------------------------------------------

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

gs2slsxt: Generalized Spatial Panel Autoregressive 2SLS Regression

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

Syntax Options Description References

*** Examples

Acknowledgments Author

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

gs2slsxt depvar indepvars [if] [in] [weight] , id(#) [ wmfile(weight_file) wmat(weight_matrix_name_W) eigw(eig_var_name_eW) model(spgls|gs2sls|gs2slsar) aux(varlist) order(#) gmm(#) noconstant be fe re ec2sls nosa sa small level(#) vce(vcetype) ]

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

-------------------------------------------------------------------------

* id(#) Number of Cross Sections in the Model wmfile(weight_file) Open CROSS SECTION weight matrix file. gs2slsxt will convert automatically spatial cross section weight matrix to spatial PANEL weight matrix. wmat(weight_matrix_name) Set name of the new spatial panel weight matrix, it has two types; row-standardized, and binary weight matrix. eigw(eig_var_name) Set name of new panel eigenvalues variable. model(spgls, gs2sls, gs2slsar) 1- model(spgls) Spatial Panel Autoregressive Generalized Least Squares > Model When panel data model with error components are both spatially and time-wise correlated. Generalized method of moments (GMM) that suggested in Kelejian-Prucha (1999), and Kapoor-Kelejian-Prucha (2007) are used in the estimation of model(spgls) 2- model(gs2sls) Generalized Spatial Panel 2SLS Model 3- model(gs2slsar) Generalized Spatial Panel Autoregressive 2SLS Model Since no softwares available till now to estimate generalized spatial panel autoregressive 2SLS models, I designed gs2slsar as a modification of Kapoor-Kelejian-Prucha (2007), but here I let the estimations deal with Panel 2SLS models, with original constant term.

stand Use row-standardized panel weight matrix within each row sum equals 1. Default is Binary spatial panel 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)

gmm(1, 2, 3) GMM Estimators for model(spgls) 1- Initial GMM Model 2- Partial Weighted GMM Model 3- Full Weighted GMM Model

be Between Effects (BE)

fe Fixed-Effects (FE)

re Random-Effects (RE)

ec2sls Baltagi EC2SLS Random-Effects (RE) Model

noconstant Exclude Constant Term from Equation

nosa Baltagi-Chang variance components instead of Swamy-Arora

small Use (F and t-tests) instead of (chi-squared and z-tests)}

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

vce(vcetype) ols, robust, cluster, bootstrap, jackknife, hc2, hc3

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.

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

gs2slsxt estimates Spatial Panel econometric regression models.

gs2slsxt 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). 3- R2 Adjusted: R2_a=1-(1-R2)*(N-1)/(N-K-1). 3- F-Test=R2/(1-R2)*(N-K-1)/(K).

Other maximization_options allows the user to specify other maximization options (e.g., difficult, trace, iterate(#), etc.). However, you should rarely have to specify them, though they may be helpful if parameters approach boundary values.

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

Anselin, L. (2001) "Spatial Econometrics", In Baltagi, B. (Ed).: A Companion to Theoretical Econometrics Basil Blackwell: Oxford, UK.

Anselin, L. (2007) "Spatial Econometrics", In T. C. Mills and K. Patterson (Eds).: Palgrave Handbook of Econometrics. Vol 1, Econometric Theory. New York: Palgrave MacMillan.

Anselin, L. & Kelejian, H. H. (1997) "Testing for Spatial Error Autocorrelation in the Presence of Endogenous Regressors", International Regional Science Review, (20); 153-182.

Anselin, L. & Florax RJ. (1995) "New Directions in Spatial Econometrics: Introduction. In New Directions in Spatial Econometrics", Anselin L, Florax RJ (eds). Berlin, Germany: Springer-Verlag.

Anselin L., Le Gallo J. & Jayet H (2006) "Spatial Panel Econometrics" In: Matyas L, Sevestre P. (eds) The Econometrics of Panel Data, Fundamentals and Recent Developments in Theory and Practice, 3rd edn. Kluwer, Dordrecht; 901-969.

Baltagi, B.H. (2006) "Random Effects and Spatial Autocorrelation with Equal Weights" Econometric Theory 22(5); 973-984.

Elhorst, J. Paul (2003) "Specification and Estimation of Spatial Panel Data Models" International Regional Science review 26, 3; 244–268.

Elhorst, J. Paul (2009) "Spatial Panel Data Models" in Mandfred M. Fischer and Arthur Getis, eds., Handbook of Applied Spatial Analysis, Berlin: Springer.

Mudit Kapoor, Harry H. Kelejian & Ingmar R. Prucha (2007) "Panel Data Models with Spatially Correlated Error Components", Journal of Econometrics, 140; 97-130. http://econweb.umd.edu/~prucha/Papers/JE140(2007a).pdf

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

Note1: spweight or spweightxt module can be used to create Panel Spatial Weight Matrix.

Note2: You can use the dialog box for gs2slsxt. Note3: xtset is included automatically in gs2slsxt models.

-------------------------------------------------------------------------------

clear all

sysuse gs2slsxt.dta, clear

db gs2slsxt

xtset id t -------------------------------------------------------------------------------

* (1) Spatial Panel Autoregressive Feasible Generalized Least Squares

gs2slsxt y x1 x2 , wmfile(SPWxt) wmat(W) eigw(eW) id(7) model(spgls) gmm(1)

gs2slsxt y x1 x2 , wmfile(SPWxt) wmat(W) eigw(eW) id(7) model(spgls) gmm(2)

gs2slsxt y x1 x2 , wmfile(SPWxt) wmat(W) eigw(eW) id(7) model(spgls) gmm(3) -------------------------------------------------------------------------------

* (2) Generalized Spatial Panel 2SLS Models

gs2slsxt y x1 x2, wmfile(SPWxt) wmat(W) eigw(eW) id(7) model(gs2sls) order(1)

gs2slsxt y x1 x2, wmfile(SPWxt) wmat(W) eigw(eW) id(7) model(gs2sls) order(2)

gs2slsxt y x1 x2, wmfile(SPWxt) wmat(W) eigw(eW) id(7) model(gs2sls) order(3)

gs2slsxt y x1 x2, wmfile(SPWxt) wmat(W) eigw(eW) id(7) model(gs2sls) order(4)

-------------------------------------------------------------------------------

* (3) Generalized Spatial Panel Autoregressive 2SLS Models

gs2slsxt y x1 x2, wmfile(SPWxt) wmat(W) eigw(eW) id(7) model(gs2slsar) order( > 1) lmi haus

gs2slsxt y x1 x2, wmfile(SPWxt) wmat(W) eigw(eW) id(7) model(gs2slsar) order( > 2) lmi haus

gs2slsxt y x1 x2, wmfile(SPWxt) wmat(W) eigw(eW) id(7) model(gs2slsar) order( > 3) lmi haus

gs2slsxt y x1 x2, wmfile(SPWxt) wmat(W) eigw(eW) id(7) model(gs2slsar) order( > 4) lmi haus -------------------------------------------------------------------------------

* (1) Spatial Panel Autoregressive Feasible Generalized Least Squares (Cont.) This example is taken from Prucha data about Spatial Panel Regression. More details can be found in: http://econweb.umd.edu/~prucha/Research_Prog3.ht > m Results of model(spgls) with gmm(3) option is identical to: http://econweb.umd.edu/~prucha/STATPROG/PANOLS/PROGRAM3(L3).log

clear all

sysuse gs2slsxt1.dta, clear

gs2slsxt y x1 , wmfile(SPWxt1) wmat(W) eigw(eW) id(100) model(spgls) gmm(1)

gs2slsxt y x1 , wmfile(SPWxt1) wmat(W) eigw(eW) id(100) model(spgls) gmm(2)

gs2slsxt y x1 , wmfile(SPWxt1) wmat(W) eigw(eW) id(100) model(spgls) gmm(3)

-------------------------------------------------------------------------------

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

I would like to thank professor: Mudit Kapoor, Harry H. Kelejian and Ingmar R > . 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

+-------------------+ ----+ gs2slsxt Citation +------------------------------------------------

Shehata, Emad Abd Elmessih (2011) GS2SLSXT: "Stata Module to Estimate GS2SLS Generalized Spatial Panel Autoregressive Two-Stage Least Squares Regression"

Online Help:

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