-------------------------------------------------------------------------------
help: lmasem                                                        dialog: lma
> sem
-------------------------------------------------------------------------------

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

lmasem: Overall System Autocorrelation Tests after (SEM) Regressions

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

lmasem

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

lmasem computes overall system autocorrelation, after: - (SEM) Structural Equation Modeling Regressions sem for system of simultaneous equations.

lmasem calculates Harvey and Guilkey autocorrelation LM tests: - Harvey LM test, see Judge et al(1985, p.494) eq.12.3.45. - Guilkey LM test, see Judge et al(1985, p.494) eq.12.3.46. - Durbin-Watson DW test.

1- Harvey Single Equation LM test = N(Rho_i) ~ Chi2(1) Ho: No Autocorrelation in eq. # : Pij=0

Q 2- Harvey Overall System LM test = N [ Sum(Rho_i) ] ~ Chi2(Q) i=1

3- Guilkey Overall System LM test = R'[ inv(Sig) # E1'E1 ] R ~ Chi2(Q^2) Ho: No Autocorrelation in the Overall System: P11 = P22 = PMM = 0

where N = Number of Observations. Q = Number of Equations. Rho_i = Autoregressive Coefficient of eq. i E1 = Lagged Residuals Matrix [(N-1)xQ]. R = Vector of Rho Coefficients. Sig = Sigma hat Matrix.

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

lmasem saves the following in r():

Scalars

r(rho_#) Rho Value for eq.# r(lmh_#) Durbin-Watson Single Equation Test for eq.# r(lmh_#) Harvey Single Equation LM Test for eq.# r(lmhp_#) Harvey Single Equation LM Test P-Value for eq.# r(lmh) Harvey Overall System Autocorrelation LM test r(lmhp) Harvey Overall System Autocorrelation LM test P-Value r(lmg) Guilkey Overall System Autocorrelation LM test r(lmgp) Guilkey Overall System Autocorrelation LM test P-Value

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

in this example FIML will be used as follows:

clear all

sysuse lmasem.dta , clear

sem (y1 <- y2 x1 x2) (y2 <- y1 x3 x4), cov(e.y1*e.y2)

lmasem

return list

* If you want to use dialog box: Press OK to compute lmcovsem

db lmasem

. clear all . sysuse lmasem.dta , clear . sem (y1 <- y2 x1 x2) (y2 <- y1 x3 x4 x1), cov(e.y1*e.y2)

Structural equation model Number of obs = 17 Estimation method = ml Log likelihood = -363.31131 ------------------------------------------------------------------------------ | OIM | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- Structural | y1 <- | y2 | .2425937 .2106232 1.15 0.249 -.1702201 .6554075 x1 | .2568409 .462485 0.56 0.579 -.649613 1.163295 x2 | -1.037016 .3154059 -3.29 0.001 -1.6552 -.4188317 _cons | 147.0826 54.4491 2.70 0.007 40.36431 253.8009 -----------+---------------------------------------------------------------- y2 <- | y1 | -.6282929 .6148239 -1.02 0.307 -1.833326 .5767398 x3 | -.5226661 .3235637 -1.62 0.106 -1.156839 .1115071 x4 | 3.4208 1.440664 2.37 0.018 .5971513 6.244449 _cons | 62.44495 42.36071 1.47 0.140 -20.58052 145.4704 -------------+---------------------------------------------------------------- Variance | e.y1 | 80.17577 28.99122 39.46865 162.8673 e.y2 | 142.4478 80.80501 46.86006 433.0208 -------------+---------------------------------------------------------------- Covariance | e.y1 | e.y2 | 25.62619 53.75243 0.48 0.634 -79.72665 130.979 ------------------------------------------------------------------------------ LR test of model vs. saturated: chi2(2) = 0.12, Prob > chi2 = 0.9408

. lmasem ============================================================================== * SEM Autocorrelation Tests (ml) * Structural Equation Modeling: SEM - Method(ml) ============================================================================== *** Single Equation Autocorrelation Tests: Ho: No Autocorrelation in eq. #: Pij=0

Eq. 1 : Harvey LM Test = 0.1236 Rho = 0.0073 P-Value > Chi2(1) 0.7251 Eq. 2 : Harvey LM Test = 0.0784 Rho = 0.0046 P-Value > Chi2(1) 0.7794 ------------------------------------------------------------------------------ Eq. 1 : Durbin-Watson DW Test = 2.1245 Eq. 2 : Durbin-Watson DW Test = 2.1245 ------------------------------------------------------------------------------ *** Overall SEM Autocorrelation Tests: Ho: No Overall SEM Autocorrelation: P11 = P22 = PMM = 0

- Harvey LM Test = 0.2021 P-Value > Chi2(2) 0.9039 - Guilkey LM Test = 4.1344 P-Value > Chi2(4) 0.3881 ------------------------------------------------------------------------------

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

Guilkey, David K. (1974) "Alternative Tests for a First-Order Vector Autoregressive Error Specification", Journal of Econometrics, vol.2(1); 95-104.

Guilkey, David K. (1975) "A Test for the Presence of First-Order Vector Autoregressive Errors When Lagged Endogenous Variables Are Present", Econometrica, vol.43, July; 711-117.

Guilkey, David K. Peter Schmidt (1973) "Estimation of Seemingly Unrelated Regression Equations with First-Order Autoregressive Errors", {it:Journal of the American Statistical Association, vol. 68, September; 642-647.

Harvey, Andrew C. (1982) "A Test of Misspecification for Systems of Equations", Discussion Paper No. A31, London School of. Economics Econometrics Programme, London, England.

Harvey, Andrew C. (1990) "The Econometric Analysis of Time Series", 2nd Edition, MIT Press Books, The MIT Press, edition 2, volume 1, number 026208189x.

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; 494.

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

+-----------------+ ----+ lmasem Citation +-------------------------------------------------- Shehata, Emad Abd Elmessih (2012) LMASEM: "Stata Module to Compute Overall System Autocorrelation Tests after Structural Equation Modeling (SEM) Regressions"

Online Help:

lmasem, lmhsem, lmnsem, lmcovsem, r2sem, lmareg3, lmhreg3, lmnreg3, lmcovreg3, r2reg3. (if installed).