********************************************* * ANALYSE DE VARIANCE À MESURES RÉPÉTÉES *; ********************************************* ********************************************* * LECTURE DES DONNEES: UNE LIGNE PAR SUJET * *********************************************; data chienmulti; input chien groupe t1 t3 t5 t7 t9 t11 t13; datalines; 1 1 4.0 4.0 4.1 3.6 3.6 3.8 3.1 2 1 4.2 4.3 3.7 3.7 4.8 5.0 5.2 3 1 4.3 4.2 4.3 4.3 4.5 5.8 5.4 4 1 4.2 4.4 4.6 4.9 5.3 5.6 4.9 5 1 4.6 4.4 5.3 5.6 5.9 5.9 5.3 6 1 3.1 3.6 4.9 5.2 5.3 4.2 4.1 7 1 3.7 3.9 3.9 4.8 5.2 5.4 4.2 8 1 4.3 4.2 4.4 5.2 5.6 5.4 4.7 9 2 3.4 3.4 3.5 3.1 3.1 3.7 3.3 10 2 3.0 3.2 3.0 3.0 3.1 3.2 3.1 11 2 3.0 3.1 3.2 3.0 3.3 3.0 3.0 12 2 3.1 3.2 3.2 3.2 3.3 3.1 3.1 13 2 3.8 3.9 4.0 2.9 3.5 3.5 3.4 14 2 3.0 3.6 3.2 3.1 3.0 3.0 3.0 15 2 3.3 3.3 3.3 3.4 3.6 3.1 3.1 16 2 4.2 4.0 4.2 4.1 4.2 4.0 4.0 17 3 3.2 3.3 3.8 3.8 4.4 4.2 3.7 18 3 3.3 3.4 3.4 3.7 3.7 3.6 3.7 19 3 3.1 3.3 3.2 3.1 3.2 3.1 3.1 20 3 3.6 3.4 3.5 4.6 4.9 5.2 4.4 21 3 4.5 4.5 5.4 5.7 4.9 4.0 4.0 22 3 3.7 4.0 4.4 4.2 4.6 4.8 5.4 23 3 3.5 3.9 5.8 5.4 4.9 5.3 5.6 24 3 3.9 4.0 4.1 5.0 5.4 4.4 3.9 25 4 3.1 3.5 3.5 3.2 3.0 3.0 3.2 26 4 3.3 3.2 3.6 3.7 3.7 4.2 4.4 27 4 3.5 3.9 4.7 4.3 3.9 3.4 3.5 28 4 3.4 3.4 3.5 3.3 3.4 3.2 3.4 29 4 3.7 3.8 4.2 4.3 3.6 3.8 3.7 30 4 4.0 4.6 4.8 4.9 5.4 5.6 4.8 31 4 4.2 3.9 4.5 4.7 3.9 3.8 3.7 32 4 4.1 4.1 3.7 4.0 4.1 4.6 4.7 ; ************************************************************** * CREATION DES DONNEES UNIVARIEES: UNE LIGNE PAR OBSERVATION * **************************************************************; proc transpose data=chienmulti out=chien(rename=(col1=potassium)) ; by chien groupe; var t1 t3 t5 t7 t9 t11 t13;run; data chien; set chien; if _NAME_="t1" then temps=1; else if _NAME_="t3" then temps=3; else if _NAME_="t5" then temps=5; else if _NAME_="t7" then temps=7; else if _NAME_="t9" then temps=9; else if _NAME_="t11" then temps=11; else if _NAME_="t13" then temps=13; drop _NAME_; keep chien groupe temps potassium;run; ****************************************************** * ANALYSE EXPLORATOIRE PAR STATISTIQUES DESCRIPTIVES * * (MOYENNES PAR GROUPE, BOXPLOTS) * ******************************************************; proc means data=chienmulti; by groupe; var t1 t3 t5 t7 t9 t11 t13;run; proc tabulate data=chien; var potassium; class groupe temps; table (groupe all)*potassium=' ',(temps all)*(mean);run; proc sgplot data=chien; vbox potassium/category=groupe; run; *************************************** * GRAPHIQUE DES PROFILS PAR INDIVIDU * ***************************************; proc sort data=chien;by groupe; run; proc sgpanel data=chien; panelby groupe; series x=temps y=potassium/group=chien markers markerattrs=(symbol=CircleFilled); run; ******************************************** * GRAPHIQUE DES PROFILS MOYENS PAR GROUPE * ********************************************; proc sort data=chien; by groupe temps; proc means data=chien noprint; by groupe temps; var potassium; output out=moy1 mean=potassium_moyen;run; proc sgplot data=moy1; series x=temps y=potassium_moyen/group=groupe markers markerattrs=(symbol=CircleFilled); run; ********************************* * COVARIANCES ECHANTILLONNALES * *********************************; proc corr data=chienmulti cov ; *by groupe; var t1 t3 t5 t7 t9 t11 t13;run;quit; ************************** * CHOIX DE LA COVARIANCE * **************************; proc mixed data=chien covtest ic; class chien groupe temps; model potassium = groupe temps groupe*temps ; *repeated temps/type=un subject=chien(groupe); *repeated temps/type=un group=groupe subject=chien(groupe); *repeated temps/type=vc subject=chien(groupe); *repeated temps/type=vc group=groupe subject=chien(groupe); *repeated temps/type=cs subject=chien(groupe); *repeated temps/type=cs group=groupe subject=chien(groupe); *repeated temps/type=csh subject=chien(groupe); *repeated temps/type=csh group=groupe subject=chien(groupe); *repeated temps/type=ar(1) subject=chien(groupe); *repeated temps/type=ar(1) group=groupe subject=chien(groupe); repeated temps/type=arh(1) subject=chien(groupe); *repeated temps/type=arh(1) group=groupe subject=chien(groupe); *repeated temps/type=toep subject=chien(groupe); *repeated temps/type=toep group=groupe subject=chien(groupe); *repeated temps/type=toeph subject=chien(groupe); run;quit; ****************************************** * ANALYSE AVEC LA STRUCTURE SÉLECTIONNÉE * ******************************************; proc mixed data=chien covtest; class chien groupe temps; model potassium=groupe temps groupe*temps/outpm=out vciry ;*ddfm=satterth; repeated temps/type=arh(1) subject=chien(groupe) r; *lsmeans groupe*temps/slice=groupe slice=temps pdiff; estimate "t3" intercept 1 groupe .25 .25 .25 .25 temps 0 0 1 0 0 0 0 groupe*temps 0 0 0.25 0 0 0 0 0 0 0.25 0 0 0 0 0 0 0.25 0 0 0 0 0 0 0.25 0 0 0 0; estimate "t1-t3" temps 1 0 -1 0 0 0 0 groupe*temps 0.25 0 -0.25 0 0 0 0 0.25 0 -0.25 0 0 0 0 0.25 0 -0.25 0 0 0 0 0.25 0 -0.25 0 0 0 0 ; estimate "groupe 2" intercept 1 groupe 0 1 0 0 temps 0.142857 0.142857 0.142857 0.142857 0.142857 0.142857 0.142857 groupe*temps 0 0 0 0 0 0 0 0.142857 0.142857 0.142857 0.142857 0.142857 0.142857 0.142857 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; estimate "groupe 2-groupe 4" groupe 0 1 0 -1 groupe*temps 0 0 0 0 0 0 0 0.142857 0.142857 0.142857 0.142857 0.142857 0.142857 0.142857 0 0 0 0 0 0 0 -0.142857 -0.142857 -0.142857 -0.142857 -0.142857 -0.142857 -0.142857; run;quit; *********************** * ANALYSE DES RÉSIDUS * ***********************; proc univariate data=out normal; var ScaledResid; run;