** Chapter 4.7 ** for W.H. Greene, Econometric Analysis 6th ed. ***************** * (c) Noel Roy 2003, 2008 * * THE NORMALITY ASSUMPTION AND BASIC STATISTICAL INFERENCE * 4.7.1 Testing a Hypothesis about a Coefficient * * The tutorial for this section will review the following tasks in SHAZAM: * • Generating dummy variables (DUM command) * • Excluding observations (SKIPIF command) * • Calculating the covariance matrix of OLS estimates (OLS / PCOV command) * *=============================================================================== * * Example 4.3 (p. 53) Earnings Equation * SAMPLE 1 753 READ (TableF4-1.txt) LFP WHRS KL6 K618 Age Educatn WW /SKIPLINES=37 * * The data file consists of 753 observations on 19 variables. However, only * the first 7 variables are needed to estimate the earnings equation, so these * are all we need to read. SHAZAM will read the first seven variables on each * line, then drop to the next line, until 753 lines are read (unless an error * is encountered). However, the block of variables to be read must be contiguous * and the first set of variables on the line. * * LISTing a dataset this large is obviously impractical. We can do some checking * of the data using a STAT command, to verify that the data "look right". * The /ALL option lists STATs for ALL the data. * STAT /ALL * * The earnings equation only uses data for women with a labour force attachment * (i.e., LFP is 1 rather than 0). Observations that do not satisfy this * condition can be skipped in estimation procedures by the SKIPIF command. An * observation is skipped if the expression contained in the SKIPIF command is * positive. * By default, SHAZAM prints a warning when an observation is skipped. In this * data set, with 300 skips, it would be desirable to turn off the warnings. * SET NOWARNSKIP SKIPIF (1-LFP) * * The dependent variable is the log of earnings, where earnings are defined as * hourly wage (WW) times hours worked(WHRS). The explanatory variables are age * (Age), age squared, education (Educatn), and a binary variable Kids reflecting the * presence of children under 18 in the household. These can be created where * necessary using GENR commands. The variable Kids will be constructed using * the DUM(x) function, which takes a value of 1 for positive x and 0 otherwise. * GENR LNEARN=LOG(WW*WHRS) GENR Age2=Age**2 GENR Kids=DUM(KL6+K618) * * The estimated covariance matrix for the OLS estimates will be printed if the * OLS command is run with the PCOV option. The LOGLIN option corrects the * calculated elasticities and the log-likelihood function for the fact that * the dependent variable (but not the independent variables) is in LOG form. * OLS LNEARN Age Age2 Educatn Kids / PCOV LOGLIN STOP * *=============================================================================== * * Updated August 27, 2008