** Chapter 10.2 ** for W.H. Greene, Econometric Analysis 6th ed. ***************** * (c) Noel Roy 2003, 2008 * * THE SEEMINGLY UNRELATED REGRESSIONS MODEL * * This tutorial reviews the following tasks in SHAZAM: * • Estimating systems of equations with cross-equation correlation (SYSTEM command) * • Maximum-likelihood estimation through iteration (SYSTEM /ITER=) * • Estimating pooled OLS models allowing for groupwise heteroskedasticity and * cross-section correlation(POOL command). * *=============================================================================== * This example uses Grunfeld's Investment Data as described on p. 252 and * detailed in Table F9.3, which contains data on 5 firms over a 20 year period. * READ (TableF9-3.prn) /NAMES * * To estimate a set of separate regressions for each firm, separate variables * must be defined. * TIME 1935 1 SAMPLE 1935.0 1954.0 DO #=1,5 GEN1 L=-20*(#-1) GENR I#=LAG(I,L) GENR F#=LAG(F,L) GENR C#=LAG(C,L) ENDO * * First, use OLS to obtain equation-by-equation estimates of these relationships. OLS I1 F1 C1 /DN OLS I2 F2 C2 /DN OLS I3 F3 C3 /DN OLS I4 F4 C4 /DN OLS I5 F5 C5 /DN * * * Now, use the SYSTEM command to estimate a set of seemingly unrelated regression * equations. * A set of seemingly unrelated regression equations can be estimated with the * general command format: * SYSTEM neq / options * OLS depvar indeps * . . . * OLS depvar indeps * where neq is the number of equations and options is a list of desired options. * After the SYSTEM command there must be one OLS command for each equation in the * system. Options must not be specified on the OLS commands. * The SYSTEM command is discussed further in chapter 29 of the SHAZAM Manual. * * The SYSTEM command adds a constant term to each equation by default. Since * we wish to test the hypothesis that the coefficients in all five equations * are the same, the constant term must be specified manually. * GENR CONSTANT=1 SYSTEM 5 / RESID=ERR DN NOCONSTANT SIGMA=SIGMA OLS I1 F1 C1 CONSTANT OLS I2 F2 C2 CONSTANT OLS I3 F3 C3 CONSTANT OLS I4 F4 C4 CONSTANT OLS I5 F5 C5 CONSTANT END * * The residual covariance matrix is printed as "ITERATION 1 SIGMA" * in the printed output. The option SIGMA= saves the matrix in the named * variable. In addition, LR and LM tests of a diagonal covariance * matrix (i.e., equation disturbances are not correlated), as in * (10-16) and (10-17) respectively, are reported. The strong * rejection of the null hypothesis by both tests suggests that there * is an efficiency gain in SUR estimation over single-equation OLS. * * The option RESID= saves the FGLS residuals to a TxM (20x5) matrix * for further analysis. * * We can test the hypothesis that the 5 equations have the same coefficients. When a test involves * the coefficient of a variable that appears in more than one equation (for example, * CONSTANT), the test must specify the equation in which the coefficient involved in the * test appears, in the form varname:eqno (e.g., CONSTANT:1 is the constant term in the * first equation of the system). When a variable appears in only one equation (here, all * the F's and C's), the equation number can be omitted without ambiguity. TEST TEST F1=F2 TEST F1=F3 TEST F1=F4 TEST F1=F5 TEST C1=C2 TEST C1=C3 TEST C1=C4 TEST C1=C5 TEST CONSTANT:1=CONSTANT:2 TEST CONSTANT:1=CONSTANT:3 TEST CONSTANT:1=CONSTANT:4 TEST CONSTANT:1=CONSTANT:5 END * * SHAZAM only calculates the Wald statistic (10-14) here, because the * F-statistic is only valid approximately in this context. However, * since the numerator in the F-statistic (10-12) is equal to Wald/J, * it can be easily calculated. The TEST command stores the Wald statistic * in $CHI and the degrees of freedom in $DF1, so $CHI/$DF1 gives the numerator, * so the F-statistic (10-13) can then be obtained. * GEN1 Fhat=$CHI/$DF1 GEN1 DF2=5*($N-$K) DISTRIB FhaT /TYPE=F DF1=$DF1 DF2=DF2 * * The denominator of (10-12) can be calculated with a little more effort. * First, stack the residuals to all equations into one long vector EPSILON. MATRIX EPSILON=VEC(ERR) * The Kroneker product @ of the inverse of SIGMA and an identity matrix (of order 20) * gives an estimate of the inverse of Omega (equation 10-6). Therefore, (10-12) can * be calculated as * MATRIX Ftest=Fhat/(EPSILON'(INV(SIGMA)@IDEN(20))*EPSILON/(5*($N-$K))) DISTRIB Ftest /TYPE=F DF1=$DF1 DF2=DF2 DELETE DF2 * * All tests strongly reject the null hypothesis that the coefficients are * the same in all equations. * * Print the correlation matrix of the FGLS residuals (10-11). Note that these are * saved in a TxM (20x5) matrix, and the STAT command analyzes the columns. * ?STAT ERR / PCOR * * The Restricted estimates (where all equations have the same coefficients) * can be obtained by the POOL command. The NCROSS= option specifies the * number of cross-section units in the panel. RHO=0 suppresses any * correction for autocorrelation. FULL allows for cross-sectional correlation * as well as groupwise heteroskedasticity. The LM tests on these assumptions * are automatically generated by the POOL command. See ch. 24 of the SHAZAM manual * for more information about the POOL command. * POOL I F C / NCROSS=5 RHO=0 FULL BEG=1 END=100 * STOP * *=============================================================================== * Updated September 29, 2008