open data4-10 set echo off set messages off # do the test manually, using the SSR values ols ENROLL 0 CATHOL PUPIL INCOME scalar SSRu = $ess scalar dfu = $df ols ENROLL 0 CATHOL --quiet scalar SSRr = $ess scalar F1 = ((SSRr - SSRu)/2)/(SSRu/dfu) scalar pv1 = pvalue(F, 2, dfu, F1) printf "*** manual SSR method: F = %g, pvalue = %g\n", F1, pv1 # do the test manually, Wald method ols ENROLL 0 CATHOL PUPIL INCOME --quiet matrix R = zeros(2,4) R[1,3] = 1 R[2,4] = 1 matrix q = zeros(2,1) matrix b = $coeff matrix Vb = $vcv print R scalar F2 = (R*b-q)'*inv(R*Vb*R')*(R*b-q) / 2 pv2 = pvalue(F, 2, dfu, F2) printf "*** manual Wald method: F = %g, pvalue = %g\n", F2, pv2 # try gretl's built-in "omit" method ols ENROLL 0 CATHOL PUPIL INCOME --quiet omit PUPIL INCOME # try gretl's built-in "restrict" method ols ENROLL 0 CATHOL PUPIL INCOME --quiet restrict b3 = 0 b4 = 0 end restrict