* Illustrating a few ways to test the General Linear Hypothesis in SAS ; data canadianprestige ; infile 'c:\temp\prestige.txt' firstobs = 2 ; length occupation $ 25 ; input occupation $ education income women prestige census type $ ; if type ne 'NA' ; title 'Canadian Prestige data'; run ; proc print data = canadianprestige (obs = 10) ; run ; proc reg data = canadianprestige ; model prestige = education income / xpx ; test education = income ; run ; proc iml ; xpx = {98 1057.92 680008, 1057.92 12153.35 7988004.2, 680008 7988004.2 6452557530} ; xpy = {4638.1, 54018.4, 37114096.3} ; residss = 5272.44 ; invxpx = inv(xpx) ; bhat = invxpx*xpy ; print invxpx ; print bhat ; l1 = {0 1 0, 0 0 1 } ; c = {0, 0} ; ssh = (l1*bhat -c)`*inv(l1*invxpx*l1`)*(l1*bhat -c) ; msh = ssh/2 ; fglobal = msh/(residss/95) ; print ssh msh fglobal ; l2 = {0 1 -1 } ; c2 = {0} ; ssh2 = (l2*bhat -c2)`*inv(l2*invxpx*l2`)*(l2*bhat -c2) ; msh2 = ssh2/1 ; fh2 = msh2/(residss/95) ; print ssh2 msh2 fh2 ; quit ;