-------------------------------------------------------------------------------
help: spgmmxt                                                   dialog: spgmmxt
-------------------------------------------------------------------------------

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

spgmmxt: Spatial Panel Autoregressive Generalized Method of Moments Regression

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

Syntax Description Options Spatial Panel Aautocorrelation Tests Model Selection Diagnostic Criteria Heteroscedasticity Tests Non Normality Tests Saved Results References

*** Examples

Acknowledgments Author

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

spgmmxt depvar indepvars , nc(#) [ wmfile(weight_file) lmspac lmhet lmnorm diag tests coll zero tobit tolog nolog robust stand inv inv2 gmm(#) noconstant mfx(lin, log) predict(new_var) resid(new_var) iter(#) tech(name) ll(real 0) level(#) vce(vcetype) maximize other maximization options ]

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

spgmmxt estimates Spatial Panel Autoregressive Generalized Method of Moments Re > gression 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) is used in the estimation of (spgmmxt)

spgmmxt can also estimate Tobit Spatial Panel Autoregressive GMM with option(t > obit)

spgmmxt estimates Continuous and Truncated Dependent Variables models tobit.

spgmmxt deals with data either continuous or truncated dependent variable. If depvar has missing values or lower limits, so in this case spgmmxt will fit spatial cross section model via tobit model, and thus spgmmxt can resolve the problem of missing values that exist in many kinds of data. Otherwise, in the case of continuous data, the normal estimation will be used.

spgmmxt can generate: - Binary / Standardized Weight Matrix. - Inverse / Inverse Squared Standardized Weight Matrix. - Binary / Standardized / Inverse Eigenvalues Variable.

R2, R2 Adjusted, and F-Test, are obtained from 4 ways: 1- (Buse 1973) R2. 2- Raw Moments R2. 3- squared correlation between predicted (Yh) and observed dependent variable (Y). 4- Ratio of variance between predicted (Yh) and observed dependent variable (Y).

- Adjusted R2: R2_a=1-(1-R2)*(N-1)/(N-K-1). - F-Test=R2/(1-R2)*(N-K-1)/(K).

*** Important Notes: spgmmxt generates some variables names with prefix: w1x_ , w2x_ , w3x_ , w4x_ , w1y_ , w2y_ , mstar_ , spat_ So, you must avoid to include variables names with thes prefixes

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

* nc(#) Number of Cross Sections Units Time series observations must be Balanced in each Cross Section

wmfile(weight_file) Open CROSS SECTION weight matrix file. spgmmxt will convert automatically spatial cross section wei > ght matrix to spatial PANEL weight matrix.

Spatial Weight Matrix file must be: 1- [SxS] Cross Sections units Dimentions, and not Panel dimentions 2- Square Matrix 3- Symmetric Matrix (Optional)

Spatial Panel Weight Matrix has two types: Standardized and binary weight mat > rix.

stand Use Standardized Panel Weight Matrix, (each row sum equals 1 > ) Default is Binary spatial panel weight matrix which each ele > ment is 0 or 1

inv Use Inverse Standardized Weight Matrix (1/W)

inv2 Use Inverse Squared Standardized Weight Matrix (1/W^2)

zero convert missing values observations to Zero

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

coll keep collinear variables; default is removing collinear vari > ables.

noconstant Exclude Constant Term from Equation

tests display ALL lmh, lmn, lmsp, diag tests

tobit Estimate (spgmmxt) via Tobit Spatial Panel GMM

ll(#) value of minimum left-censoring dependent variable; default > is 0

mfx(lin, log) functional form: Linear model (lin), or Log-Log model (log), to compute Total, Direct, and InDirect Marginal Effects and > Elasticities - In Linear model: marginal effects are the coefficients (Bm), and elasticities are (Es = Bm X/Y). - In Log-Log model: elasticities are the coefficients (Es), and the marginal effects are (Bm = Es Y/X). - mfx(log) and tolog options must be combined, to transform linear variables > to log form.

tolog Convert dependent and independent variables to LOG Form in the memory for Log-Log regression. tolog Transforms depvar and indepvars to Log Form without lost the original data variables

predict(new_variable) Predicted values variable

resid(new_variable) Residuals values variable computed as Ue=Y-Yh ; that is known as combined residual: [Ue = > U_i + E_it] in xtreg models overall error component is computed as: [E_it] see: xtreg postestimation##predict

robust Huber-White standard errors

tech(name) technique algorithm for maximization of the log likelihood f > unction LLF tech(nr) Newton-Raphson (NR) algorithm; default tech(bhhh) Berndt-Hall-Hall-Hausman (BHHH) algorithm tech(dfp) Davidon-Fletcher-Powell (DFP) algorithm tech(bfgs) Broyden-Fletcher-Goldfarb-Shanno (BFGS) algorithm

iter(#) maximum iterations; default is 100 if iter(#) is reached (100), this means convergence not ach > ieved yet, so you can use another technique algorithm to converge LLF > function or exceed number of maximum iterations more than 100.

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

level(#) confidence intervals level; default is level(95)

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.

+--------------------------------------+ ----+ Spatial Panel Aautocorrelation Tests +-----------------------------

lmspac Spatial Panel Aautocorrelation Tests: * Ho: Error has No Spatial AutoCorrelation Ha: Error has Spatial AutoCorrelation - GLOBAL Moran MI Test - GLOBAL Geary GC Test - GLOBAL Getis-Ords GO Test - Moran MI Error Test - LM Error [SEM] (Burridge) Test - LM Error [SEM] (Robust) Test * Ho: Spatial Lagged Dependent Variable has No Spatial AutoCorrelation Ha: Spatial Lagged Dependent Variable has Spatial AutoCorrelation - LM Lag [SAR] (Anselin) Test - LM Lag [SAR] (Robust) Test * Ho: No General Spatial AutoCorrelation Ha: General Spatial AutoCorrelation - LM SAC (LMErr+LMLag_R) Test - LM SAC (LMLag+LMErr_R) Test

Definitions:

- Spatial autocorrelation: chock in one country affects neighboring countrie > s

- Spatial autocorrelation: is correlation of a variable with itself in space > .

- Spatial Lag Model: Y = BX + rWy + e ; e = lWe+u - Spatial Error Model: Y = BX + e ; e = lWe+u - Spatial Durbin Model: Y = BX + aWX* + rWy + e ; e = lWe+u - General Spatial Model: Y = BX + rWy + LW1y + e ; e = lW1e+u - General Spatial Model: Y = BX + rWy + LW1y + e ; e = lW1e+u

- General Spatial Model is used to deal with both types of spatial dependenc > e, namely Spatial Lag Dependence and Spatial Error Dependence

- Spatial Error Model is used to handle the spatial dependence due to the omitted variables or errors in measurement through the error term

- Spatial Autoregressive Model (SAR) is also known as Spatial Lag Model

- Positive spatial autocorrelation exists when high values correlate with high neighboring values or when low values correlate with low neighboring values

- Negative spatial autocorrelation exists when high values correlate with low neighboring values and vice versa.

- presence of positive spatial autocorrelation results in a loss of informat > ion, which is related to greater uncertainty, less precision, and larger standa > rd errors.

- Spatial autocorrelation coefficients (in contrast to their counterparts in > time) are not constrained by -1/+1. Their range depends on the choice of weights > matrix.

- Spatial dependence exists when the value associated with one location is dependent on those of other locations.

- Spatial heterogeneity exists when structural changes related to location exist in a dataset, it can result in non-constant error variance (heteroscedasticity) across areas, especially when scale-related measurement errors are present.

- Spatial regression models are statistical models that account for the presence of spatial effects, i.e., spatial autocorrelation (or more generally spatial dependence) and/or spatial heterogeneity.

- if LM test for spatial lag is more significant than LM test for spatial er > ror, and robust LM test for spatial lag is significant but robust LM test for spatial error is not, then the appropriate model is spatial lag model. Conversely, if LM test for spatial error is more significant than LM test for spatial lag and robust LM test for spatial error is significant but robust LM test for spatial lag is not, then the appropriate specificat > ion is spatial error model, [Anselin-Florax (1995)]. - robust versions of Spatial LM tests are considered only when standard versions (LM-Lag or LM-Error) are significant - General Spatial Model is used to deal with both types of spatial dependenc > e, namely spatial lag dependence and spatial error dependence - Spatial Error Model is used to handle spatial dependence due to omitted variables or errors in measurement through the error term - Spatial Autoregressive Model (SAR) is also known as Spatial Lag Model

+-------------------------------------------+ ----+ Panel Model Selection Diagnostic Criteria +------------------------

diag Spatial Panel Model Selection Diagnostic Criteria: - Log Likelihood Function LLF - Akaike Information Criterion (1974) AIC - Akaike Information Criterion (1973) Log AIC - Schwarz Criterion (1978) SC - Schwarz Criterion (1978) Log SC - Amemiya Prediction Criterion (1969) FPE - Hannan-Quinn Criterion (1979) HQ - Rice Criterion (1984) Rice - Shibata Criterion (1981) Shibata - Craven-Wahba Generalized Cross Validation (1979) GCV

+--------------------------------+ ----+ Panel Heteroscedasticity Tests +-----------------------------------

lmhet Spatial Panel Heteroscedasticity Tests: * Ho: Panel Homoscedasticity - Ha: Panel Heteroscedasticity - Engle LM ARCH Test AR(1) E2 =E2_1 - Hall-Pagan LM Test: E2 = Yh - Hall-Pagan LM Test: E2 = Yh2 - Hall-Pagan LM Test: E2 = LYh2 - Harvey LM Test: LogE2 = X - Wald Test: LogE2 = X - Glejser LM Test: |E| = X - Machado-Santos-Silva LM Test: Ev= Yh Yh2 - Machado-Santos-Silva LM Test: Ev= X - Breusch-Godfrey Test: E = E_1 X - White Test - Koenker(R2): E2 = X - White Test - B-P-G (SSR): E2 = X - White Test - Koenker(R2): E2 = X X2 - White Test - B-P-G (SSR): E2 = X X2 - White Test - Koenker(R2): E2 = X X2 XX - White Test - B-P-G (SSR): E2 = X X2 XX - Cook-Weisberg LM Test E = Yh - Cook-Weisberg LM Test E = X *** Single Variable Tests - Cook-Weisberg LM Test: E = xi - King LM Test: E = xi

*** Groupwise Panel Heteroscedasticity Tests * Ho: Panel Homoscedasticity - Ha: Panel Groupwise Heteroscedasticity - Lagrange Multiplier LM Test - Likelihood Ratio LR Test - Wald Test

*** Panel Tobit Model Heteroscedasticity LM Tests - Separate LM Tests - Ho: Homoscedasticity - Joint LM Test - Ho: Homoscedasticity

+---------------------------+ ----+ Panel Non Normality Tests +----------------------------------------

lmnorm Spatial Panel Non Normality Tests: * Ho: Panel Normality - Ha: Panel Non Normality *** Non Normality Tests: - Jarque-Bera LM Test - White IM Test - Doornik-Hansen LM Test - Geary LM Test - Anderson-Darling Z Test - D'Agostino-Pearson LM Test *** Skewness Tests: - Srivastava LM Skewness Test - Small LM Skewness Test - Skewness Z Test - Skewness Coefficient - Standard Deviation *** Kurtosis Tests: - Srivastava Z Kurtosis Test - Small LM Kurtosis Test - Kurtosis Z Test - Kurtosis Coefficient - Standard Deviation *** Runs Tests: - Runs Test: - Standard Deviation Runs Sig(k) - Mean Runs E(k) - 95% Conf. Interval [E(k)+/- 1.96* Sig(k)] *** Tobit Panel Non Normality Tests *** LM Test - Ho: No Skewness *** LM test - Ho: No Kurtosis *** LM Test - Ho: Normality (No Kurtosis, No Skewness) - Pagan-Vella LM Test - Chesher-Irish LM Test

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

Depending on the model estimated, spgmmxt saves the following results in e():

Scalars

*** Spatial Panel Aautocorrelation Tests: e(mig) GLOBAL Moran MI Test e(migp) GLOBAL Moran MI Test P-Value e(gcg) GLOBAL Geary GC Test e(gcgp) GLOBAL Geary GC Test P-Value e(gog) GLOBAL Getis-Ords Test GO e(gogp) GLOBAL Getis-Ords GO Test P-Value e(mi1) Moran MI Error Test e(mi1p) Moran MI Error Test P-Value e(lmerr) LM Error (Burridge) Test e(lmerrp) LM Error (Burridge) Test P-Value e(lmerrr) LM Error (Robust) Test e(lmerrrp) LM Error (Robust) Test P-Value e(lmlag) LM Lag (Anselin) Test e(lmlagp) LM Lag (Anselin) Test P-Value e(lmlagr) LM Lag (Robust) Test e(lmlagrp) LM Lag (Robust) Test P-Value e(lmsac1) LM SAC (LMLag+LMErr_R) Test e(lmsac1p) LM SAC (LMLag+LMErr_R) Test P-Value e(lmsac2) LM SAC (LMErr+LMLag_R) Test e(lmsac2p) LM SAC (LMErr+LMLag_R) Test P-Value

*** Spatial Panel Model Selection Diagnostic Criteria:

e(N) number of observations e(r2bu) R-squared (Buse 1973) e(r2bu_a) R-squared Adj (Buse 1973) e(r2raw) Raw Moments R2 e(r2raw_a) Raw Moments R2 Adj e(f) F-test e(fp) F-test P-Value e(wald) Wald-test e(waldp) Wald-test P-Value e(r2h) R2 Between Predicted (Yh) and Observed DepVar (Y) e(r2h_a) Adjusted r2h e(fh) F-test due to r2h e(fhp) F-test due to r2h P-Value e(r2v) R2 Variance Ratio Between Predicted (Yh) and Observed DepVar > (Y) e(r2v_a) Adjusted r2v e(fv) F-test due to r2v e(fvp) F-test due to r2v P-Value e(sig) Root MSE (Sigma)

e(llf) Log Likelihood Function LLF e(aic) Akaike Information Criterion (1974) AIC e(laic) Akaike Information Criterion (1973) Log AIC e(sc) Schwarz Criterion (1978) SC e(lsc) Schwarz Criterion (1978) Log SC e(fpe) Amemiya Prediction Criterion (1969) FPE e(hq) Hannan-Quinn Criterion (1979) HQ e(rice) Rice Criterion (1984) Rice e(shibata) Shibata Criterion (1981) Shibata e(gcv) Craven-Wahba Generalized Cross Validation (1979) GCV

*** Spatial Panel Heteroscedasticity Tests: e(lmharch) Engle LM ARCH Test AR(1) e(lmharchp) Engle LM ARCH Test AR(1) P-Value e(lmhhp1) Hall-Pagan LM Test E2 = Yh e(lmhhp1p) Hall-Pagan LM Test E2 = Yh P-Value e(lmhhp2) Hall-Pagan LM Test E2 = Yh2 e(lmhhp2p) Hall-Pagan LM Test E2 = Yh2 P-Value e(lmhhp3) Hall-Pagan LM Test E2 = Yh3 e(lmhhp3p) Hall-Pagan LM Test E2 = Yh3 P-Value e(lmhw01) White Test - Koenker(R2) E2 = X e(lmhw01p) White Test - Koenker(R2) E2 = X P-Value e(lmhw02) White Test - B-P-G (SSR) E2 = X e(lmhw02p) White Test - B-P-G (SSR) E2 = X P-Value e(lmhw11) White Test - Koenker(R2) E2 = X X2 e(lmhw11p) White Test - Koenker(R2) E2 = X X2 P-Value e(lmhw12) White Test - B-P-G (SSR) E2 = X X2 e(lmhw12p) White Test - B-P-G (SSR) E2 = X X2 P-Value e(lmhw21) White Test - Koenker(R2) E2 = X X2 XX e(lmhw21p) White Test - Koenker(R2) E2 = X X2 XX P-Value e(lmhw22) White Test - B-P-G (SSR) E2 = X X2 XX e(lmhw22p) White Test - B-P-G (SSR) E2 = X X2 XX P-Value e(lmhharv) Harvey LM Test e(lmhharvp) Harvey LM Test P-Value e(lmhwald) Wald Test e(lmhwaldp) Wald Test P-Value e(lmhgl) Glejser LM Test e(lmhglp) Glejser LM Test P-Value e(lmhmss1) Machado-Santos-Silva LM Test: Ev=Yh Yh2 e(lmhmss1p) Machado-Santos-Silva LM Test: Ev=Yh Yh2 P-Value e(lmhmss2) Machado-Santos-Silva LM Test: Ev=X e(lmhmss2p) Machado-Santos-Silva LM Test: Ev=X P-Value e(lmhbg) Breusch-Godfrey Test e(lmhbgp) Breusch-Godfrey Test P-Value e(lmhcw1) Cook-Weisberg LM Test E = Yh e(lmhcw1p) Cook-Weisberg LM Test E = Y P-Valueh e(lmhcw2) Cook-Weisberg LM Test E = X e(lmhcw2p) Cook-Weisberg LM Test E = X P-Value

*** Spatial Panel Groupwise Heteroscedasticity Tests: e(lmhglm) Lagrange Multiplier LM Test e(lmhglmp) Lagrange Multiplier LM Test P-Value e(lmhglr) Likelihood Ratio LR Test e(lmhglrp) Likelihood Ratio LR Test P-Value e(lmhgw) Wald Test e(lmhgwp) Wald Test P-Value

*** Spatial Panel Non Normality Tests: e(lmnjb) Jarque-Bera LM Test e(lmnjbp) Jarque-Bera LM Test P-Value e(lmnw) White IM Test e(lmnwp) White IM Test P-Value e(lmndh) Doornik-Hansen LM Test e(lmndhp) Doornik-Hansen LM Test P-Value e(lmng) Geary LM Test e(lmngp) Geary LM Test P-Value e(lmnad) Anderson-Darling Z Test e(lmnadp) Anderson-Darling Z Test P-Value e(lmndp) D'Agostino-Pearson LM Test e(lmndpp) D'Agostino-Pearson LM Test P-Value e(lmnsvs) Srivastava LM Skewness Test e(lmnsvsp) Srivastava LM Skewness Test P-Value e(lmnsms1) Small LM Skewness Test e(lmnsms1p) Small LM Skewness Test P-Value e(lmnsms2) Skewness Z Test e(lmnsms2p) Skewness Z Test P-Value e(lmnsvk) Srivastava Z Kurtosis Test e(lmnsvkp) Srivastava Z Kurtosis Test P-Value e(lmnsmk1) Small LM Kurtosis Test e(lmnsmk1p) Small LM Kurtosis Test P-Value e(lmnsmk2) Kurtosis Z Test e(lmnsmk2p) Kurtosis Z Test P-Value e(sk) Skewness Coefficient e(sksd) Skewness Standard Deviation e(ku) Kurtosis Coefficient e(kusd) Kurtosis Standard Deviation e(sn) Standard Deviation Runs Sig(k) e(en) Mean Runs E(k) e(lower) Lower 95% Conf. Interval [E(k)- 1.96* Sig(k)] e(upper) Upper 95% Conf. Interval [E(k)+ 1.96* Sig(k)]

e(lmnpv) Pagan-Vella LM Test (Tobit Model) e(lmnpvp) Pagan-Vella LM Test (Tobit Model) P-Value e(lmnci) Chesher-Irish LM Test (Tobit Model) e(lmncip) Chesher-Irish LM Test (Tobit Model) P-Value

Matrixes e(b) coefficient vector e(V) variance-covariance matrix of the estimators e(mfxlin) Marginal Effect and Elasticity in Lin Form e(mfxlog) Marginal Effect and Elasticity in Log Form

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

Anderson, T.W. & C. Hsiao (1982) "Formulation and Estimation of Dynamic Models Using Panel Data", Journal of Econometrics, 18; 47–82.

Anderson T.W. & Darling D.A. (1954) "A Test of Goodness of Fit", Journal of the American Statisical Association, 49; 765–69.

Anderson, T. W. & H. Rubin (1950) "The Asymptotic Properties of Estimates of the Parameters of a Single Equation in a Complete System of Stochastic Equations", Annals of Mathematical Statistics, Vol. 21; 570-82.

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.

Arellano, M. and S. Bond (1991) "Some Tests of Specification for Panel Data: Monte Carlo Evidence and an Application to Employment Equations" The Review of Economic Studies 58; 277-297.

Arellano, M. and S. Bond (1998) "Dynamic Panel Data Estimation Using DPD98 for Gauss" : A Guide for Users.

Arellano, M. and O. Bover (1995) "Another Look at the Instrumental Variable Estimation of Error-Components Models" Journal of Econometrics 68; 29-51.

Breusch, Trevor & Adrian Pagan (1980) "The Lagrange Multiplier Test and its Applications to Model Specification in Econometrics", Review of Economic Studies 47; 239-253.

C.M. Jarque & A.K. Bera (1987) "A Test for Normality of Observations and Regression Residuals" International Statistical Review , Vol. 55; 163-172.

Cook, R.D., & S. Weisberg (1983) "Diagnostics for Heteroscedasticity in Regression", Biometrica 70; 1-10.

D'Agostino, R. B., & Rosman, B. (1974) "The Power of Geary’s Test of Normality", Biometrika, 61(1); 181-184.

Damodar Gujarati (1995) "Basic Econometrics" 3rd Edition, McGraw Hill, New York, USA.

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.

Engle, Robert (1982) "Autoregressive Conditional Heteroscedasticity with Estimates of Variance of United Kingdom Inflation" Econometrica, 50(4), July; 987-1007.

Geary R.C. (1947) "Testing for Normality" Biometrika, Vol. 34; 209-242.

Geary R.C. (1970) "Relative Efficiency of Count of Sign Changes for Assessing Residuals Autoregression in Least Squares Regression" Biometrika, Vol. 57; 123-127.

Greene, William (2007) "Econometric Analysis", 6th ed., Macmillan Publishing Company Inc., New York, USA..

Griffiths, W., R. Carter Hill & George Judge (1993) "Learning and Practicing Econometrics", John Wiley & Sons, Inc., New York, USA.

Harvey, Andrew (1990) "The Econometric Analysis of Time Series", 2nd edition, MIT Press, Cambridge, Massachusetts.

Hays, Jude C., Aya Kachi & Robert J. Franzese, Jr (2010) "A Spatial Model Incorporating Dynamic, Endogenous Network Interdependence: A Political Science Application", Statistical Methodology 7(3); 406-428.

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

Judge, Georege, R. Carter Hill, William . E. Griffiths, Helmut Lutkepohl, & Tsoung-Chao Lee (1988) "Introduction To The Theory And Practice Of Econometrics", 2nd ed., John Wiley & Sons, Inc., New York, USA.

Judge, Georege, W. E. Griffiths, R. Carter Hill, Helmut Lutkepohl, & Tsoung-Chao Lee(1985) "The Theory and Practice of Econometrics", 2nd ed., John Wiley & Sons, Inc., New York, USA.

Kmenta, Jan (1986) "Elements of Econometrics", 2nd ed., Macmillan Publishing Company, Inc., New York, USA; 618-625.

Koenker, R. (1981) "A Note on Studentizing a Test for Heteroskedasticity", Journal of Econometrics, Vol.17; 107-112.

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

Pagan, Adrian .R. & Hall, D. (1983) "Diagnostic Tests as Residual Analysis", Econometric Reviews, Vol.2, No.2,. 159-218.

Pearson, E. S., D'Agostino, R. B., & Bowman, K. O. (1977) "Tests for Departure from Normality: Comparison of Powers", Biometrika, 64(2); 231-246.

Sargan, J.D. (1958) "The Estimation of Economic Relationships Using Instrumental Variables", Econometrica, vol.26; 393-415.

Szroeter, J. (1978) "A Class of Parametric Tests for Heteroscedasticity in Linear Econometric Models", Econometrica, 46; 1311-28.

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

Wooldridge, Jeffrey M. (2002) "Econometric Analysis of Cross Section and Panel Data", The MIT Press, Cambridge, Massachusetts, London, England.

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

Note 1: you can use: spweight, spweightcs, spweightxt to create Spatial Weight > Matrix. Note 2: Remember, your spatial weight matrix must be: *** 1-Cross Section Dimention 2- Square Matrix 3- Symmetric Matrix Note 3: You can use the dialog box for spgmmxt. Note 4: xtset is included automatically in spgmmxt models.

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

clear all

sysuse spgmmxt.dta, clear

db spgmmxt

* (1) Spatial Panel Autoregressive Generalized Method of Moments spgmmxt y x1 x2 , nc(7) wmfile(SPWxt) gmm(1) mfx(lin) test spgmmxt y x1 x2 , nc(7) wmfile(SPWxt) gmm(2) mfx(lin) test spgmmxt y x1 x2 , nc(7) wmfile(SPWxt) gmm(3) mfx(lin) test

spgmmxt y x1 x2 , nc(7) wmfile(SPWxt) gmm(1) mfx(log) test tolog spgmmxt y x1 x2 , nc(7) wmfile(SPWxt) gmm(2) mfx(log) test tolog spgmmxt y x1 x2 , nc(7) wmfile(SPWxt) gmm(3) mfx(log) test tolog -------------------------------------------------------------------------------

* (2) Tobit Spatial Panel Autoregressive Generalized Method of Moments spgmmxt ys x1 x2 , nc(7) wmfile(SPWxt) gmm(1) mfx(lin) test tobit ll(0) spgmmxt ys x1 x2 , nc(7) wmfile(SPWxt) gmm(2) mfx(lin) test tobit ll(0) spgmmxt ys x1 x2 , nc(7) wmfile(SPWxt) gmm(3) mfx(lin) test tobit ll(0)

spgmmxt ys x1 x2 , nc(7) wmfile(SPWxt) gmm(3) mfx(lin) test tobit ll(3) -------------------------------------------------------------------------------

* (3) Spatial Panel Autoregressive Generalized Method of Moments (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.htm Results of (spgmmxt) with gmm(3) option is identical to: http://econweb.umd.edu/~prucha/STATPROG/PANOLS/PROGRAM3(L3).log

clear all sysuse spgmmxt1.dta, clear spgmmxt y x1 , wmfile(SPWxt1) nc(100) gmm(1) stand spgmmxt y x1 , wmfile(SPWxt1) nc(100) gmm(2) stand spgmmxt y x1 , wmfile(SPWxt1) nc(100) gmm(3) stand -------------------------------------------------------------------------------

. clear all . sysuse spgmmxt.dta, clear . spgmmxt y x1 x2 , nc(7) wmfile(SPWxt) mfx(lin) test

============================================================================== *** Binary (0/1) Weight Matrix: 49x49 - NC=7 NT=7 (Non Normalized) ============================================================================== ============================================================================== * Spatial Panel Autoregressive Generalized Method of Moments (SPGMM) ============================================================================== *** Initial GMM Model: 1 y = x1 + x2 ------------------------------------------------------------------------------ Sample Size = 49 | Cross Sections Number = 7 Wald Test = 45.3388 | P-Value > Chi2(2) = 0.0000 F-Test = 22.6694 | P-Value > F(2 , 40) = 0.0000 (Buse 1973) R2 = 0.7748 | Raw Moments R2 = 0.9590 (Buse 1973) R2 Adj = 0.7297 | Raw Moments R2 Adj = 0.9509 Root MSE (Sigma) = 8.6984 | Log Likelihood Function = -170.5500 ------------------------------------------------------------------------------ - R2h= 0.5500 R2h Adj= 0.4600 F-Test = 28.11 P-Value > F(2 , 40) 0.0000 - R2v= 0.4508 R2v Adj= 0.3410 F-Test = 18.88 P-Value > F(2 , 40) 0.0000 ------------------------------------------------------------------------------ y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- x1 | -.2904423 .0941184 -3.09 0.004 -.4806627 -.1002219 x2 | -1.323453 .3309552 -4.00 0.000 -1.992338 -.6545674 _cons | 64.47419 5.091475 12.66 0.000 54.18394 74.76445 ------------------------------------------------------------------------------

============================================================================== * Panel Model Selection Diagnostic Criteria ============================================================================== - Log Likelihood Function LLF = -170.5500 - Akaike Final Prediction Error AIC = 347.0999 - Schwarz Criterion SC = 352.7754 - Akaike Information Criterion ln AIC = 4.2458 - Schwarz Criterion ln SC = 4.3616 - Amemiya Prediction Criterion FPE = 80.2952 - Hannan-Quinn Criterion HQ = 72.9474 - Rice Criterion Rice = 70.3840 - Shibata Criterion Shibata = 69.3287 - Craven-Wahba Generalized Cross Validation-GCV = 70.0846 ------------------------------------------------------------------------------

============================================================================== *** Spatial Panel Aautocorrelation Tests ============================================================================== Ho: Error has No Spatial AutoCorrelation Ha: Error has Spatial AutoCorrelation

- GLOBAL Moran MI = 0.0594 P-Value > Z( 0.705) 0.4805 - GLOBAL Geary GC = 0.8831 P-Value > Z(-0.828) 0.4076 - GLOBAL Getis-Ords GO = -0.1698 P-Value > Z(-0.705) 0.4805 ------------------------------------------------------------------------------ - Moran MI Error Test = 0.3779 P-Value > Z(3.505) 0.7055 ------------------------------------------------------------------------------ - LM Error (Burridge) = 0.1647 P-Value > Chi2(1) 0.6849 - LM Error (Robust) = 0.6335 P-Value > Chi2(1) 0.4261 ------------------------------------------------------------------------------ Ho: Spatial Lagged Dependent Variable has No Spatial AutoCorrelation Ha: Spatial Lagged Dependent Variable has Spatial AutoCorrelation

- LM Lag (Anselin) = 0.3204 P-Value > Chi2(1) 0.5714 - LM Lag (Robust) = 0.7891 P-Value > Chi2(1) 0.3744 ------------------------------------------------------------------------------ Ho: No General Spatial AutoCorrelation Ha: General Spatial AutoCorrelation

- LM SAC (LMErr+LMLag_R) = 0.9539 P-Value > Chi2(2) 0.6207 - LM SAC (LMLag+LMErr_R) = 0.9539 P-Value > Chi2(2) 0.6207 ------------------------------------------------------------------------------

============================================================================== *** Panel Heteroscedasticity Tests ============================================================================== Ho: Panel Homoscedasticity - Ha: Panel Heteroscedasticity

- Engle LM ARCH Test AR(1): E2 = E2_1 = 0.5025 P-Value > Chi2(1) 0.4784 ------------------------------------------------------------------------------ - Hall-Pagan LM Test: E2 = Yh = 0.0254 P-Value > Chi2(1) 0.8734 - Hall-Pagan LM Test: E2 = Yh2 = 0.0000 P-Value > Chi2(1) 0.9968 - Hall-Pagan LM Test: E2 = LYh2 = 0.2283 P-Value > Chi2(1) 0.6328 ------------------------------------------------------------------------------ - Harvey LM Test: LogE2 = X = 2.4753 P-Value > Chi2(2) 0.2901 - Wald Test: LogE2 = X = 6.1075 P-Value > Chi2(1) 0.0135 - Glejser LM Test: |E| = X = 8.3688 P-Value > Chi2(2) 0.0152 - Breusch-Godfrey Test: E = E_1 X = 10.9753 P-Value > Chi2(1) 0.0009 ------------------------------------------------------------------------------ - Machado-Santos-Silva Test: Ev=Yh Yh2 = 0.2531 P-Value > Chi2(2) 0.8811 - Machado-Santos-Silva Test: Ev=X = 7.2616 P-Value > Chi2(2) 0.0265 ------------------------------------------------------------------------------ - White Test - Koenker(R2): E2 = X = 9.8517 P-Value > Chi2(2) 0.0073 - White Test - B-P-G (SSR): E2 = X = 14.2397 P-Value > Chi2(2) 0.0008 ------------------------------------------------------------------------------ - White Test - Koenker(R2): E2 = X X2 = 11.7997 P-Value > Chi2(4) 0.0189 - White Test - B-P-G (SSR): E2 = X X2 = 17.0553 P-Value > Chi2(4) 0.0019 ------------------------------------------------------------------------------ - White Test - Koenker(R2): E2 = X X2 XX= 24.9319 P-Value > Chi2(5) 0.0001 - White Test - B-P-G (SSR): E2 = X X2 XX= 36.0364 P-Value > Chi2(5) 0.0000 ------------------------------------------------------------------------------ - Cook-Weisberg LM Test: E2/S2n = Yh = 0.0367 P-Value > Chi2(1) 0.8481 - Cook-Weisberg LM Test: E2/S2n = X = 14.2397 P-Value > Chi2(2) 0.0008 ------------------------------------------------------------------------------ *** Single Variable Tests (E2/Sig2): - Cook-Weisberg LM Test: x1 = 4.1504 P-Value > Chi2(1) 0.0416 - Cook-Weisberg LM Test: x2 = 3.0020 P-Value > Chi2(1) 0.0832 ------------------------------------------------------------------------------ *** Single Variable Tests: - King LM Test: x1 = 0.3196 P-Value > Chi2(1) 0.5718 - King LM Test: x2 = 2.9761 P-Value > Chi2(1) 0.0845 ------------------------------------------------------------------------------

============================================================================== * Panel Groupwise Heteroscedasticity Tests ============================================================================== Ho: Panel Homoscedasticity - Ha: Panel Groupwise Heteroscedasticity

- Lagrange Multiplier LM Test = 7.3373 P-Value > Chi2(6) 0.2908 - Likelihood Ratio LR Test = 7.1253 P-Value > Chi2(6) 0.3094 - Wald Test = 12.4812 P-Value > Chi2(7) 0.0858 ------------------------------------------------------------------------------

============================================================================== * Panel Non Normality Tests ============================================================================== Ho: Normality - Ha: Non Normality ------------------------------------------------------------------------------ *** Non Normality Tests: - Jarque-Bera LM Test = 1.8192 P-Value > Chi2(2) 0.4027 - White IM Test = 11.9460 P-Value > Chi2(2) 0.0025 - Doornik-Hansen LM Test = 4.7489 P-Value > Chi2(2) 0.0931 - Geary LM Test = -0.7192 P-Value > Chi2(2) 0.6980 - Anderson-Darling Z Test = 0.3559 P > Z( 0.087) 0.5346 - D'Agostino-Pearson LM Test = 2.6169 P-Value > Chi2(2) 0.2702 ------------------------------------------------------------------------------ *** Skewness Tests: - Srivastava LM Skewness Test = 0.1992 P-Value > Chi2(1) 0.6554 - Small LM Skewness Test = 0.2464 P-Value > Chi2(1) 0.6196 - Skewness Z Test = -0.4964 P-Value > Chi2(1) 0.6196 ------------------------------------------------------------------------------ *** Kurtosis Tests: - Srivastava Z Kurtosis Test = 1.2728 P-Value > Z(0,1) 0.2031 - Small LM Kurtosis Test = 2.3705 P-Value > Chi2(1) 0.1236 - Kurtosis Z Test = 1.5396 P-Value > Chi2(1) 0.1236 ------------------------------------------------------------------------------ Skewness Coefficient = -0.1562 - Standard Deviation = 0.3398 Kurtosis Coefficient = 3.8908 - Standard Deviation = 0.6681 ------------------------------------------------------------------------------ Runs Test: (23) Runs - (24) Positives - (25) Negatives Standard Deviation Runs Sig(k) = 3.4619 , Mean Runs E(k) = 25.4898 95% Conf. Interval [E(k)+/- 1.96* Sig(k)] = (18.7045 , 32.2751 ) ------------------------------------------------------------------------------

* Linear: Marginal Effect - Elasticity *

+-----------------------------------------------------------------------------+ | Variable | Marginal_Effect(B) | Elasticity(Es) | Mean | |--------------+--------------------+--------------------+--------------------| | x1 | -0.2904 | -0.3178 | 38.4362 | | x2 | -1.3235 | -0.5416 | 14.3749 | +-----------------------------------------------------------------------------+ Mean of Dependent Variable = 35.1288

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

I would like to thank Mudit Kapoor, Harry H. Kelejian and Ingmar R. Prucha.

+--------+ ----+ Author +-----------------------------------------------------------

Emad Abd Elmessih Shehata Professor (PhD Economics) 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

+------------------+ ----+ SPGMMXT Citation +-------------------------------------------------

Shehata, Emad Abd Elmessih (2012) SPGMMXT: "Spatial Panel Autoregressive Generalized Method of Moments Regression"

http://ideas.repec.org/c/boc/bocode/s457480a.html

http://econpapers.repec.org/software/bocbocode/s457480a.htm

Online Help:

*** Spatial Econometrics Regression Models:

------------------------------------------------------------------------------- > - *** (1) Spatial Panel Data Regression Models: spregxt Spatial Panel Regression Econometric Models: Stata Module Toolkit gs2slsxt Generalized Spatial Panel 2SLS Regression gs2slsarxt Generalized Spatial Panel Autoregressive 2SLS Regression spglsxt Spatial Panel Autoregressive Generalized Least Squares Regression spgmmxt Spatial Panel Autoregressive Generalized Method of Moments Regress > ion spmstarxt (m-STAR) Spatial Lag Panel Models spmstardxt (m-STAR) Spatial Durbin Panel Models spmstardhxt (m-STAR) Spatial Durbin Multiplicative Heteroscedasticity Panel Mo > dels spmstarhxt (m-STAR) Spatial Lag Multiplicative Heteroscedasticity Panel Model > s spregdhp Spatial Panel Han-Philips Linear Dynamic Regression: Lag & Durbin > Models spregdpd Spatial Panel Arellano-Bond Linear Dynamic Regression: Lag & Durbi > n Models spregfext Spatial Panel Fixed Effects Regression: Lag & Durbin Models spregrext Spatial Panel Random Effects Regression: Lag & Durbin Models spregsacxt MLE Spatial AutoCorrelation Panel Regression (SAC) spregsarxt MLE Spatial Lag Panel Regression (SAR) spregsdmxt MLE Spatial Durbin Panel Regression (SDM) spregsemxt MLE Spatial Error Panel Regression (SEM) ------------------------------------------------------------------------------- > - *** (2) Spatial Cross Section Regression Models: spregcs Spatial Cross Section Regression Econometric Models: Stata Module > Toolkit gs2sls Generalized Spatial 2SLS Cross Sections Regression gs2slsar Generalized Spatial Autoregressive 2SLS Cross Sections Regression gs3sls Generalized Spatial Autoregressive 3SLS Regression gs3slsar Generalized Spatial Autoregressive 3SLS Cross Sections Regression gsp3sls Generalized Spatial 3SLS Cross Sections Regression spautoreg Spatial Cross Section Regression Models spgmm Spatial Autoregressive GMM Cross Sections Regression spmstar (m-STAR) Spatial Lag Cross Sections Models spmstard (m-STAR) Spatial Durbin Cross Sections Models spmstardh (m-STAR) Spatial Durbin Multiplicative Heteroscedasticity Cross Se > ctions Models spmstarh (m-STAR) Spatial Lag Multiplicative Heteroscedasticity Cross Secti > ons Models spregsac MLE Spatial AutoCorrelation Cross Sections Regression (SAC) spregsar MLE Spatial Lag Cross Sections Regression (SAR) spregsdm MLE Spatial Durbin Cross Sections Regression (SDM) spregsem MLE Spatial Error Cross Sections Regression (SEM) ------------------------------------------------------------------------------- > - *** (3) Tobit Spatial Regression Models:

*** (3-1) Tobit Spatial Panel Data Regression Models: sptobitgmmxt Tobit Spatial GMM Panel Regression sptobitmstarxtTobit (m-STAR) Spatial Lag Panel Models sptobitmstardxtTobit (m-STAR) Spatial Durbin Panel Models sptobitmstardhxtTobit (m-STAR) Spatial Durbin Multiplicative Heteroscedasticity > Panel Models sptobitmstarhxtTobit (m-STAR) Spatial Lag Multiplicative Heteroscedasticity Pan > el Models sptobitsacxt Tobit MLE Spatial AutoCorrelation (SAC) Panel Regression sptobitsarxt Tobit MLE Spatial Lag Panel Regression sptobitsdmxt Tobit MLE Spatial Panel Durbin Regression sptobitsemxt Tobit MLE Spatial Error Panel Regression spxttobit Tobit Spatial Panel Autoregressive GLS Regression -------------------------------------------------------------- *** (3-2) Tobit Spatial Cross Section Regression Models: sptobitgmm Tobit Spatial GMM Cross Sections Regression sptobitmstar Tobit (m-STAR) Spatial Lag Cross Sections Models sptobitmstardTobit (m-STAR) Spatial Durbin Cross Sections Models sptobitmstardhTobit (m-STAR) Spatial Durbin Multiplicative Heteroscedasticity C > ross Sections sptobitmstarhTobit (m-STAR) Spatial Lag Multiplicative Heteroscedasticity Cross > Sections sptobitsac Tobit MLE AutoCorrelation (SAC) Cross Sections Regression sptobitsar Tobit MLE Spatial Lag Cross Sections Regression sptobitsdm Tobit MLE Spatial Durbin Cross Sections Regression sptobitsem Tobit MLE Spatial Error Cross Sections Regression ------------------------------------------------------------------------------- > - *** (4) Spatial Weight Matrix: spcs2xt Convert Cross Section to Panel Spatial Weight Matrix spweight Cross Section and Panel Spatial Weight Matrix spweightcs Cross Section Spatial Weight Matrix spweightxt Panel Spatial Weight Matrix ------------------------------------------------------------------------------- > -