PROC IMPORT OUT= WORK.anova DATAFILE= "C:\Documents and Settings\hraissi\Bureau\ANOVA.xls" DBMS=EXCEL REPLACE; SHEET="Feuil1$"; GETNAMES=YES; MIXED=NO; SCANTEXT=YES; USEDATE=YES; SCANTIME=YES; RUN; PROC IML; use work.anova; read all var{NonOptMath OptMath} into note; nNOM=nrow(note[,1]);/*effectif autre option maths*/ nOM=nrow(note[,2]);/*effectif opt math*/ n=nOM+nNOM;/*effectif total*/ moygen=(note[+,1]+note[+,2])/n;/*moy générale*/ moyNOM=note[+,1]/nNOM;/*moy autre option maths*/ print moyNOM; moyOM=note[+,2]/nOM;/*moy option maths*/ print moyOM; vectun=J(nNOM,1,moygen); vectdeux=J(nOM,1,moygen); vectun=(note[,1]-vectun); vectdeux=(note[,2]-vectdeux); vartotal=0; vartotalun=0; vartotaldeux=0; vartotalun=t(vectun)*vectun; vartotaldeux=t(vectdeux)*vectdeux; vartotal=(vartotalun+vartotaldeux)/n;/*variance totale*/ print vartotal; /*variance résiduelle?*/ print varesid; /*variance factorielle?*/ print varfact; somvar=0; somvar=varfact+varesid; print somvar;/*on vérifie que l'on a bien calculé les variances*/ T=0; T=(varfact/1)/(varesid/(n-2));/*stat de test*/ print T; pvalue=0; pvalue=1-probf(T,1,n-2); print pvalue; valcrit=0; valcrit=finv(0.95,1,n-2); print valcrit; run; quit;