* * Example 9.8 from page 180 * MacKinnon-White-Davidson test for functional form * open data tablef5-1[1].txt calendar(q) 1950 data(format=prn,org=columns) 1950:1 2000:4 year qtr realgdp realcons realinvs realgovt realdpi $ cpi_u m1 tbilrate unemp pop infl realint * * Run linear regression and get its fitted values * linreg m1 # constant tbilrate realgdp prj linearfit * * Run log regression and get its fitted values * set logm1 = log(m1) set logy = log(realgdp) set logr = log(tbilrate) linreg logm1 # constant logr logy prj logfit * * Compute the gaps between the fitted values * set loggap = logfit-log(linearfit) set lingap = linearfit-exp(logfit) * * Run the augmented regressions and test the added variable * linreg logm1 # constant logr logy lingap exclude(title="Test of adequacy of log form") # lingap linreg m1 # constant tbilrate realgdp loggap exclude(title="Test of adequacy of linear form") # loggap