* * File: rm.wolves.sas * * Comparison of the Repeated Measures approach to the * wolf data with the MANOVA approach. The files for the * Manova approach are on manova.wolves.sas.2 * * Data from Morrison (1990), 3rd edition, p. 288-289 * taken from Jolicoeur (1959, 1975) on measurements on * the skull dimensions of the wolf Canis Lupus L. * Variables are: * Location: rm=rocky mountain ar=arctic * Sex: m=male f=female * X1 = palatal length * X2 = postpalatal length * X3 = zygomatic width * X4 = palatal width outside the first upper molars * X5 = palatal width inside the second upper molars * X6 = width between the postglenoid foramina * X7 = interorbital width * X8 = least width of the braincase * X9 = crown length of the first upper molar ; options nocenter nodate pageno=1; DATA wolves; INPUT location $ sex $ x1-x9; LABEL X1 = 'palatal length' X2 = 'postpalatal length' X3 = 'zygomatic width' X4 = 'palatal width: first upper molars' X5 = 'palatal width: second upper molars' X6 = 'width: postglenoid foramina' X7 = 'interorbital width' X8 = 'least width of the braincase' X9 = 'crown length: first upper molar'; DATALINES; rm m 126 104 141 81.0 31.8 65.7 50.9 44.0 18.2 rm m 128 111 151 80.4 33.8 69.8 52.7 43.2 18.5 rm m 126 108 152 85.7 34.7 69.1 49.3 45.6 17.9 rm m 125 109 141 83.1 34.0 68.0 48.2 43.8 18.4 rm m 126 107 143 81.9 34.0 66.1 49.0 42.4 17.9 rm m 128 110 143 80.6 33.0 65.0 46.4 40.2 18.2 rm f 116 102 131 76.7 31.5 65.0 45.4 39.0 16.8 rm f 120 103 130 75.1 30.2 63.8 44.4 41.1 16.9 rm f 116 103 125 74.7 31.6 62.4 41.3 44.2 17.0 ar m 117 99 134 83.4 34.8 68.0 40.7 37.1 17.2 ar m 115 100 149 81.0 33.1 66.7 47.2 40.5 17.7 ar m 117 106 142 82.0 32.6 66.0 44.9 38.2 18.2 ar m 117 101 144 82.4 32.8 67.5 45.3 41.5 19.0 ar m 117 103 149 82.8 35.1 70.3 48.3 43.7 17.8 ar m 119 101 143 81.5 34.1 69.1 50.1 41.1 18.7 ar m 115 102 146 81.4 33.7 66.4 47.7 42.0 18.2 ar m 117 100 144 81.3 37.2 66.8 41.4 37.6 17.7 ar m 114 102 141 84.1 31.8 67.8 47.8 37.8 17.2 ar m 110 94 132 76.9 30.1 62.1 42.0 40.4 18.1 ar f 112 94 134 79.5 32.1 63.3 44.9 42.7 17.7 ar f 109 91 133 77.9 30.6 61.9 45.2 41.2 17.1 ar f 112 99 139 77.2 32.7 67.4 46.9 40.9 18.3 ar f 112 99 133 78.5 32.5 65.5 44.2 34.1 17.5 ar f 113 97 146 84.2 35.4 68.7 51.0 43.6 17.2 ar f 107 97 137 78.1 30.7 61.6 44.9 37.3 16.5 ; TITLE 'Wolf Skull Measurements'; PROC FACTOR CORR ROTATE=promax N=3 SCORE OUT=wolves2; VAR x1-x9; RUN; DATA wolves2 (RENAME=( factor1=width1 factor2=length factor3=width2)); SET wolves2; RUN; TITLE2 MANOVA approach; PROC GLM DATA=wolves2; CLASS sex location; MODEL width1 width2 length = sex | location; RUN; TITLE3 'Means and Least Squares Means'; MEANS sex location sex*location; LSMEANS sex location sex*location; RUN; TITLE3 'Overall MANOVA'; * --- the H= gives the hypothesized effect; MANOVA H=sex; MANOVA H=location; MANOVA H=sex*location; RUN; * profile analysis; * level; title2 'Profile analysis: Overall Level = Mass'; manova h=sex m=width1 + width2 + length; manova h=location m=width1 + width2 + length; manova h=sex*location m=width1 + width2 + length; run; * shape; title2 'Profile analysis: Shape: Sex'; manova h=sex m=width1 - length, length - width2 mnames = dwidth dw2len / summary; run; title2 'Profile analysis: Shape: Location'; manova h=location m=width1 - length, length - width2 mnames = dwidth dw2len / summary; run; title2 'Profile analysis: Shape: Sex*Location'; manova h=sex*location m=width1 - length, length - width2 mnames = dwidth dw2len / summary; run; /* --- code for the repeated measures: CONTRAST(1) ==> transform so that the contrast is with the first variable PRINTM ==> print the model matrix PRINTE ==> print the error matrices (recommended that you always inspect the error correlation matrix) SUMMARY ==> print univariate ANOVAs for the transformed variables --- */ TITLE2 'Repeated measures approach'; PROC GLM DATA=wolves2; CLASS sex location; MODEL length width1 width2 = sex | location; REPEATED factors contrast(1) / PRINTM PRINTE SUMMARY; RUN;