** Chapter 6.3 ** for W.H. Greene, Econometric Analysis 6th ed. ***************** * (c) Noel Roy 2003, 2008 * * NONLINEARITY IN THE VARIABLES * 6.3.1 Functional Forms * * The tutorial for this section will review the following tasks in SHAZAM: * • Use of index variables in DO commands * • Storing coefficient estimates * • Generating graphs * *=============================================================================== * * Replicate Figure 6.3. * Repeat the regression in Example 4.3. * SAMPLE 1 753 READ (TableF4-1.txt) LFP WHRS KL6 K618 Age Educatn WW /SKIPLINES=37 SET NOWARNSKIP SKIPIF (1-LFP) GENR LNEARN=LOG(WW*WHRS) GENR Age2=Age**2 GENR Kids=DUM(KL6+K618) ?OLS LNEARN Age Age2 Educatn Kids / COEF=B * * Calculate predicted earnings for all ages between 20 and 65, * for Education=12 and Kids=1. * DIM EARNINGS 46 GEN1 CON=B(3)*12+B(4)+B(5) DO #=1 46 GEN1 EARNINGS(#)=EXP(B(1)*(#+19)+B(2)*(#+19)**2+CON) ENDO * Graph Earnings against Age. DEL Age SAMPLE 1 46 GENR Age=TIME(19) GRAPH Earnings Age /LINEONLY NOKEY STOP * *=============================================================================== * * Updated September 2, 2008