set echo off set messages off # Part 1 open wages1.gdt series lwage = log(wage) series exper2 = exper^2 # estimate the unrestricted model ols lwage const male school exper exper2 SSRu = $ess dfu = $df matrix b = $coeff # estimate the restricted model ols lwage const male school SSRr = $ess dfr = $df # compute the F-test dfn = dfr - dfu Fval = ((SSRr-SSRu)/dfn)/(SSRu/dfu) print Fval pval = pvalue(F, dfn, dfu, Fval) print pval # find the exper value that maximizes lwage emax = -b[4]/(2*b[5]) print emax # Part 2 open data4-2 series W = 100*WAGES/PRDEFL series P = Yt - W # estimate the unrestricted model ols Ct const W P SSRu = $ess dfu = $df # estimate the restricted model ols Ct const Yt SSRr = $ess dfr = $df # compute the F-test dfn = dfr - dfu Fval = ((SSRr-SSRu)/dfn)/(SSRu/dfu) print Fval pval = pvalue(F, dfn, dfu, Fval) print pval