** Chapter 10.4 ** for W.H. Greene, Econometric Analysis 5th ed. ***************** * (c) Noel Roy 2003, 2008 * * SYSTEMS OF REGRESSION EQUATIONS * 10.4 SYSTEMS OF DEMAND EQUATIONS: SINGULAR SYSTEMS * * This tutorial will review the following tasks in SHAZAM: * • Estimating systems of equations with cross-equation correlation (SYSTEM command) * • Estimating systems of equations with cross-equation parameter constraints (SYSTEM /RESTRICT) * *=============================================================================== * * 10.4.1. Cobb-Douglas Cost Function (Example 6.3 continued) p.273 * SAMPLE 1 145 READ (TableF10-1.txt) Firm Year Cost Output PL SL PK SK PF SF /SKIPLINES=2 GENR LNCOST=LOG(COST) GENR LNY=LOG(OUTPUT) GENR LNPK=LOG(PK) GENR LNPL=LOG(PL) GENR LNPF=LOG(PF) * * First run the OLS regressions in Table 10.3. * OLS LNCOST LNY LNPK LNPL LNPF / LOGLOG RESTRICT RESTRICT LNPL+LNPF+LNPK=1 END * GENR LNYY=LNY**2 OLS LNCOST LNY LNYY LNPK LNPL LNPF / LOGLOG RESTRICT RESTRICT LNPL+LNPF+LNPK=1 END * * Now estimate the multivariate regressions, excluding the SF equation. * In this system of equations, an intercept term will be generated and the * NOCONSTANT option used. See p. 274 for the specification of the restrictions * imposed. * GENR LNCPF=LOG(COST/PF) GENR LNPKPF=LOG(PK/PF) GENR LNPLPF=LOG(PL/PF) GENR CONSTANT=1 * * 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. * * This seemingly unrelated regression imposes cross-equation parameter * restrictions on the estimates. Linear parameter restrictions can be * imposed with the general command format: * SYSTEM neq / RESTRICT options * OLS depvar indeps * . . . * OLS depvar indeps * RESTRICT equation * . . . * RESTRICT equation * END * The RESTRICT commands are specified as linear functions of the variables in the system. * The variable names represent the coefficients. When a variable appears in more than * one equation, the restriction must specify the equation in which the coefficient * involved in the test appears, in the form varname:eqno (e.g., LNPKPF:1 is the * coefficient for LNPKPF in the first equation of the system). * (When a variable appears in only one equation, the equation number can be * omitted without ambiguity). * * The SYSTEM command is discussed further in chapter 29 of the SHAZAM Manual. * SYSTEM 3 / NOCONSTANT RESTRICT DN OLS LNCPF LNY LNPKPF LNPLPF CONSTANT OLS SK CONSTANT OLS SL CONSTANT RESTRICT LNPKPF:1=CONSTANT:2 RESTRICT LNPLPF:1=CONSTANT:3 END * * The following test command computes BETAF (see equation (10-30)). * Note that the test value is available in the temporary variable $VAL. * TEST 1-CONSTANT:2-CONSTANT:3 PRINT $VAL * * Now add the quadratic term. * SYSTEM 3 / NOCONSTANT RESTRICT COEF=B OLS LNCPF LNY LNYY LNPKPF LNPLPF CONSTANT OLS SK CONSTANT OLS SL CONSTANT RESTRICT LNPKPF:1=CONSTANT:2 RESTRICT LNPLPF:1=CONSTANT:3 END * * Compute BETAF. TEST 1-CONSTANT:2-CONSTANT:3 GEN1 BF=$VAL * * Calculate the level of output which minimizes average costs, * using the coefficients saved in vector B thruogh the COEF= option. * GEN1 qstar=EXP((1-B(1))/(2*B(2))) PRINT qstar * * This value differs slightly from that reported in the textbook because * the latter is besed on Rounded values of the estimated parameters. * * We need two graphs to replicate Figure 10.1 -- one for fitted values and * one for actual values. * * Actual values GENR Actual=Cost/Output*100 * For scaling purposes the smaller one third of the firms are omitted * from figure 10.1. SAMPLE 48 145 graph Actual Output /NOKEY * Reset the graph set graph * * The fitted values are calculated at the samp[le averages of the * input prices. STAT PK PL PF /MEAN=AVG SAMPLE 1 16000 GENR MWH=TIME(0)+500 * The estimated parameter values are contained in the vector B. GENR Fitted=100*EXP((B(1)-1)*log(MWH)+B(2)*log(MWH)**2+B(3)*LOG(AVG(1)/AVG(3))+B(4)*LOG(AVG(2)/AVG(3))+B(5))*AVG(3) GRAPH Fitted MWH /lineonly nokey ** STOP * *=============================================================================== * Updated September 23, 2008