ods pdf file="Ex9_3_7.pdf"; options nocenter linesize=75 pagesize=66; data judgeall; input y x2 x3; datalines; 41.65077 14.53 16.74 40.99370 15.30 16.81 39.78592 15.92 19.50 50.31161 17.41 22.12 56.97006 18.37 22.34 52.41802 18.83 17.47 51.74554 18.84 20.24 59.74142 19.71 20.37 40.64725 20.01 12.71 46.96075 20.26 22.98 51.27611 20.77 19.33 49.41824 21.17 17.04 51.52437 21.34 16.74 54.41408 22.91 19.81 60.90809 22.96 31.92 66.65003 23.69 26.31 81.31264 24.82 25.93 58.26339 25.54 21.96 54.18337 25.63 24.05 77.73936 28.73 25.66 ; /* Exemple du test de Goldfeld-Quandt */ proc sort data=judgeall; by x2; run; data petit; set judgeall; obsnum = _N_; if obsnum <= 8; run; data grand; set judgeall; obsnum = _N_; if obsnum >= 13; run; proc reg data=petit; model y = x2 x3; run; proc reg data=grand; model y = x2 x3; run; /* Exemple du test de Breush-Pagan-Godfrey */ goptions reset=all gaccess='sasgastd > fig9_3_7.pdf' device=pdf; goptions ftext=zapf border rotate=landscape gsfmode=append; proc reg data = judgeall; model y = x2 x3; plot r.*p.; output out=datares r=residus p=predites; run; data datares2; set datares; res2 = residus**2; x2carre = x2*x2; x3carre = x3*x3; x2x3 = x2*x3; res2stan = (1/36.3692)*res2; run; /* Remarque: Ne pas oublier de diviser les residus au carre par "sum res^2/n" */ /* Regression des residus au carre standardise sur x2 */ proc reg data=datares2; model res2stan = x2; title 'Information pour le test de Breusch-Pagan-Godfrey'; run; /* Exemple du test de White */ proc reg data=datares2; model res2 = x2 x3 x2carre x3carre x2x3; title 'Information pour le test de White'; run; ods pdf close;