**Here's the satrt of building the 'bockaov.dat' file MTB > stack c1-c4 c10; SUBC> subscripts c11. **Here's the person MTB > set c12 DATA> 4(1:64) DATA> end **Here's gender (first 36 subjects male) MTB > set c13 DATA> 36(1) 28(0) 36(1) 28(0) DATA> 36(1) 28(0) 36(1) 28(0) DATA> end MTB > print c10-c13 data set 256 (64x4) rows: c10 vocab, c11 time, c12 subj, c13 sex **Here's some descriptives on the data MTB > describe c1-c4 N MEAN MEDIAN TRMEAN STDEV SEMEAN C1 64 1.137 1.230 1.046 1.889 0.236 C2 64 2.542 2.455 2.457 2.085 0.261 C3 64 2.988 2.715 2.854 2.169 0.271 C4 64 3.472 3.270 3.403 1.925 0.241 MIN MAX Q1 Q3 C1 -2.190 8.260 -0.078 2.187 C2 -1.310 9.550 1.058 3.435 C3 -0.660 10.240 1.383 4.240 C4 -2.220 10.580 2.330 4.633 MTB > corr c1-c4 C1 C2 C3 C2 0.810 C3 0.867 0.785 C4 0.785 0.757 0.811 **Introduce gender MTB > set c5 DATA> 36(1) 28(0) DATA> end MTB > describe c1-c4; SUBC> by c5. C5 N MEAN MEDIAN TRMEAN STDEV SEMEAN C1 0 28 1.133 1.065 1.076 1.798 0.340 1 36 1.141 1.415 1.004 1.982 0.330 C2 0 28 2.756 2.635 2.732 1.706 0.322 1 36 2.375 1.770 2.234 2.348 0.391 C3 0 28 3.127 2.645 2.980 1.868 0.353 1 36 2.880 3.065 2.728 2.397 0.400 C4 0 28 3.383 3.150 3.326 1.554 0.294 1 36 3.541 3.270 3.465 2.191 0.365 C5 MIN MAX Q1 Q3 C1 0 -2.190 5.940 -0.040 2.497 1 -1.920 8.260 -0.538 2.155 C2 0 -0.420 6.560 1.813 3.503 1 -1.310 9.550 0.832 3.433 C3 0 0.710 9.360 1.630 3.910 1 -0.660 10.240 0.633 4.415 C4 0 0.530 7.720 2.443 3.918 1 -2.220 10.580 2.285 4.793 ------------------------------------------- Start repeated measures anova, no between subjects factor (one-sample), 4 levels of repeated measures **Reproduce Bock MSMBR Table 7.1-5, use twoway or anova (note model) MTB > twoway c10 c11 c12 ANALYSIS OF VARIANCE C10 SOURCE DF SS MS C11 3 194.338 64.779 C12 63 873.603 13.867 ERROR 189 154.942 0.820 TOTAL 255 1222.883 MTB > anova c10 = c11 c12; SUBC> random c12; SUBC> restricted. Factor Type Levels Values C11 fixed 4 1 2 3 4 C12 random 64 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 Analysis of Variance for C10 Source DF SS MS F P C11 3 194.338 64.779 79.02 0.000 C12 63 873.603 13.867 16.91 0.000 Error 189 154.942 0.820 Total 255 1222.883 **Now we are going to implement orthogonal polynomial decomposition of the 3 df occasions factor into linear, quadratic, cubic. The orthogonal decomp matrix for this is L Q C 1 -3 1 -1 1 -1 -1 3 1 1 -1 -3 1 3 1 1 Matrix orth 1 -3 1 -1 1 -1 -1 3 1 1 -1 -3 1 3 1 1 MTB > Name m2 = 'means' MTB > Read 1 4 'means'. DATA> 1.137 2.542 2.998 3.472 1 rows read. MTB > read 4 1 m3 DATA> -3 DATA> -1 DATA> 1 DATA> 3 4 rows read. MTB > multiply m2 m3 m11 ANSWER = 7.4610 MTB > let k11 = 7.461**2/20 MTB > print k11 K11 2.78333 MTB > let k11 = k11*64 MTB > print k11 K11 178.133 **that's the SSlinear MTB > read 4 1 m4 DATA> 1 DATA> -1 DATA> -1 DATA> 1 4 rows read. MTB > multiply m2 m4 m12 ANSWER = -0.9310 MTB > let k12 = (.931**2)*64/4 MTB > print k12 K12 13.8682 **That's the Quadratic SS MTB > read 4 1 m5 DATA> -1 DATA> 3 DATA> -3 DATA> 1 4 rows read. MTB > multiply m2 m5 m13 ANSWER = 0.9670 MTB > let k13 = (.967**2)*64/20 MTB > print k13 K13 2.99228 **That's the Cubic SS MTB > let k14 = 178.133 + 13.8682 + 2.99228 MTB > print k14 K14 194.993 That's the SSoccasions, to a not quite perfect arithmetic accuracy. ========================== SAS implementation of gender analyses data bock; input v1 v2 v3 v4 sex; datalines; 1.75 2.60 3.76 3.68 1 0.90 2.47 2.44 3.43 1 0.80 0.93 0.40 2.27 1 2.42 4.15 4.56 4.21 1 -1.31 -1.31 -0.66 -2.22 1 -1.56 1.67 0.18 2.33 1 1.09 1.50 0.52 2.33 1 -1.92 1.03 0.50 3.04 1 -1.61 0.29 0.73 3.24 1 2.47 3.64 2.87 5.38 1 -0.95 0.41 0.21 1.82 1 1.66 2.74 2.40 2.17 1 2.07 4.92 4.46 4.71 1 3.30 6.10 7.19 7.46 1 2.75 2.53 4.28 5.93 1 2.25 3.38 5.79 4.40 1 2.08 1.74 4.12 3.62 1 0.14 0.01 1.48 2.78 1 0.13 3.19 0.60 3.14 1 2.19 2.65 3.27 2.73 1 -0.64 -1.31 -0.37 4.09 1 2.02 3.45 5.32 6.01 1 2.05 1.80 3.91 2.49 1 1.48 0.47 3.63 3.88 1 1.97 2.54 3.26 5.62 1 1.35 4.63 3.54 5.24 1 -0.56 -0.36 1.14 1.34 1 0.26 0.08 1.17 2.15 1 1.22 1.41 4.66 2.62 1 -1.43 0.80 -0.03 1.04 1 -1.17 1.66 2.11 1.42 1 1.68 1.71 4.07 3.30 1 -0.47 0.93 1.30 0.76 1 2.18 6.42 4.64 4.82 1 4.21 7.08 6.00 5.65 1 8.26 9.55 10.24 10.58 1 1.24 4.90 2.42 2.54 0 5.94 6.56 9.36 7.72 0 0.87 3.36 2.58 1.73 0 -0.09 2.29 3.08 3.35 0 3.24 4.78 3.52 4.84 0 1.03 2.10 3.88 2.81 0 3.58 4.67 3.83 5.19 0 1.41 1.75 3.70 3.77 0 -0.65 -0.11 2.40 3.53 0 1.52 3.04 2.74 2.63 0 0.57 2.71 1.90 2.41 0 2.18 2.96 4.78 3.34 0 1.10 2.65 1.72 2.96 0 0.15 2.69 2.69 3.50 0 -1.27 1.26 0.71 2.68 0 2.81 5.19 6.33 5.93 0 2.62 3.54 4.86 5.80 0 0.11 2.25 1.56 3.92 0 0.61 1.14 1.35 0.53 0 -2.19 -0.42 1.54 1.16 0 1.55 2.42 1.11 2.18 0 -0.04 0.50 2.60 2.61 0 3.10 2.00 3.92 3.91 0 -0.29 2.62 1.60 1.86 0 2.28 3.39 4.91 3.89 0 2.57 5.78 5.12 4.98 0 -2.19 0.71 1.56 2.31 0 -0.04 2.44 1.79 2.64 0 ; proc glm data=bock; class sex; model v1--v4 = sex / nouni; repeated Time 4 (8 9 10 11) polynomial / summary printe; run; The SAS System 16:13 Tuesday, May 16, 2000 29 The GLM Procedure Repeated Measures Analysis of Variance Tests of Hypotheses for Between Subjects Effects Source DF Type III SS Mean Square F Value Pr > F sex 1 0.8424004 0.8424004 0.06 0.8076 Error 62 872.7608246 14.0767875 The GLM Procedure Repeated Measures Analysis of Variance Univariate Tests of Hypotheses for Within Subject Effects Adj Pr > F Source DF Type III SS Mean Square F Value Pr > F G - G H - F Time 3 191.1697409 63.7232470 77.90 <.0001 <.0001 <.0001 Time*sex 3 2.7972018 0.9324006 1.14 0.3343 0.3330 0.3343 Error(Time) 186 152.1445325 0.8179814 Greenhouse-Geisser Epsilon 0.9408 Huynh-Feldt Epsilon 1.0062 The GLM Procedure Repeated Measures Analysis of Variance Analysis of Variance of Contrast Variables Time_N represents the nth degree polynomial contrast for Time Contrast Variable: Time_1 Source DF Type III SS Mean Square F Value Pr > F Mean 1 173.1087467 173.1087467 213.99 <.0001 sex 1 0.2687714 0.2687714 0.33 0.5664 Error 62 50.1558383 0.8089651 Contrast Variable: Time_2 Source DF Type III SS Mean Square F Value Pr > F Mean 1 14.84464844 14.84464844 22.19 <.0001 sex 1 2.47817500 2.47817500 3.70 0.0588 Error 62 41.47235000 0.66890887 Contrast Variable: Time_3 Source DF Type III SS Mean Square F Value Pr > F Mean 1 3.21634571 3.21634571 3.30 0.0743 sex 1 0.05025540 0.05025540 0.05 0.8212 Error 62 60.51634429 0.97607007