*Using the demo data to show. * Using the demo data again. * Within time and Between groups (group variable w/ two levels). title "demo 1". data list free / group time1 time2 time3. begin data. 1 10 10 10 1 10 10 10 1 10 10 10 1 10 10 10 2 15 15 15 2 15 15 15 2 16 15 15 2 15 15 15 end data. GLM time1 time2 time3 BY group /WSFACTOR = time 3 /WSDESIGN = time /DESIGN = group /PLOT = PROFILE( time*group). title "demo 2". data list free / group time1 time2 time3. begin data. 1 14 19 29 1 15 25 26 1 16 16 31 1 12 24 32 2 10 21 24 2 17 26 35 2 19 22 32 2 15 23 34 end data. GLM time1 time2 time3 BY group /WSFACTOR = time 3 /WSDESIGN = time /DESIGN = group /PLOT = PROFILE( time*group). title "demo 3". data list free / group time1 time2 time3. begin data. 1 35 25 16 1 32 23 12 1 36 22 14 1 34 21 13 2 57 43 22 2 54 46 26 2 55 46 23 2 60 47 25 end data. GLM time1 time2 time3 BY group /WSFACTOR = time 3 /WSDESIGN = time /DESIGN = group /PLOT = PROFILE( time*group). title "demo 4". data list free / group time1 time2 time3. begin data. 1 35 25 12 1 34 22 13 1 36 21 18 1 35 23 15 2 31 43 57 2 35 46 58 2 37 48 51 2 32 45 53 end data. GLM time1 time2 time3 BY group /WSFACTOR = time 3 /WSDESIGN = time /DESIGN = group /PLOT = PROFILE( time*group). data list free / id exertype diet time1 time2 time3. begin data. 1 1 1 85 85 88 2 1 1 90 92 93 3 1 1 97 97 94 4 1 1 80 82 83 5 1 1 91 92 91 6 1 2 83 83 84 7 1 2 87 88 90 8 1 2 92 94 95 9 1 2 97 99 96 10 1 2 100 97 100 11 2 1 86 86 84 12 2 1 93 103 104 13 2 1 90 92 93 14 2 1 95 96 100 15 2 1 89 96 95 16 2 2 84 86 89 17 2 2 103 109 90 18 2 2 92 96 101 19 2 2 97 98 100 20 2 2 102 104 103 21 3 1 93 98 110 22 3 1 98 104 112 23 3 1 98 105 99 24 3 1 87 132 120 25 3 1 94 110 116 26 3 2 95 126 143 27 3 2 100 126 140 28 3 2 103 124 140 29 3 2 94 135 130 30 3 2 99 111 150 end data. title "Exercise example model 1, time and diet". GLM time1 time2 time3 BY diet /WSFACTOR = time 3 /WSDESIGN=time /DESIGN=diet /EMMEANS=tables( time*diet) /PLOT = PROFILE( time*diet). title "Exercise example model 2, time and exertype". GLM time1 time2 time3 BY exertype /WSFACTOR = time 3 /WSDESIGN=time /DESIGN=exertype /EMMEANS=tables( time*exertype) /PLOT = profile( time*exertype). * Showing covariances and correlations. CORRELATIONS /VARIABLES=time1 time2 time3 /STATISTICS XPROD. * Changing the data set from wide to long to be used. * in the mixed model (which requires a long data set). VARSTOCASES /MAKE pulse from time1 TO time3 /INDEX = time(3). * Using the mixed model to get the same results as the glm . * since we use the Compound Symmetry Var-Covar structure. title "model 2, compound symmetry". MIXED pulse BY exertype time /FIXED = exertype time exertype*time /REPEATED = time | SUBJECT(id) COVTYPE(cs). title "model 2, unstructured". MIXED pulse BY exertype time /FIXED = exertype time exertype*time /REPEATED = time | SUBJECT(id) COVTYPE(un). title "model 2, autoregressive". MIXED pulse BY exertype time /FIXED = exertype time exertype*time /REPEATED = time | SUBJECT(id) COVTYPE(ar1). * back to wide data file. data list free / id exertype diet time1 time2 time3. begin data. 1 1 1 85 85 88 2 1 1 90 92 93 3 1 1 97 97 94 4 1 1 80 82 83 5 1 1 91 92 91 6 1 2 83 83 84 7 1 2 87 88 90 8 1 2 92 94 95 9 1 2 97 99 96 10 1 2 100 97 100 11 2 1 86 86 84 12 2 1 93 103 104 13 2 1 90 92 93 14 2 1 95 96 100 15 2 1 89 96 95 16 2 2 84 86 89 17 2 2 103 109 90 18 2 2 92 96 101 19 2 2 97 98 100 20 2 2 102 104 103 21 3 1 93 98 110 22 3 1 98 104 112 23 3 1 98 105 99 24 3 1 87 132 120 25 3 1 94 110 116 26 3 2 95 126 143 27 3 2 100 126 140 28 3 2 103 124 140 29 3 2 94 135 130 30 3 2 99 111 150 end data. title "model 3, time exertype and diet". GLM time1 time2 time3 BY exertype diet /WSFACTOR=time 3 /WSDESIGN=time /PLOT = profile(time*exertype*diet ) . *Comparing results from manova and from glm--the same . MANOVA time1 time2 time3 BY exertype (1,3) diet (1,2) /WSFACTOR= time (3) /WSDESIGN = time /DESIGN= exertype diet /PRINT = cellinfo (means).