1) Analysis of Variance (repeated measures) 2) Analysis of Variance (replication within cells 3) Analysis of Variance (split-plot) 4) Analysis of Variance (hierarchical analysis)objective 1: Basic repeated-measure ANOVA
This is the basic repeated measure ANOVA. The model statement specifies the dependent variable that you are looking at over time. Notice that there is no independent variable (after the equal sign) in this design.
proc glm data=SASUSER.data815;
model cb33 cb34 cb35 = ;
repeated time 3 ( 1 2 3 ) ;
run;
The "repeated" statement is SASCODE indicating that this is a repeated measure ANOVA. "Time" is a name that you give to the repeated factor. You can call it whatever you wish. The "3" indicates that there are three levels for the repeated measure (e.g., time 1, time 2, and time 3) "(1 2 3) assigns the names for each of the levels. You can substitute any name you wish.
objective 2: replication within cells
Here is the input statement: input id sex age replicat time1 time2;
Here's the program:
Proc GLM data=weights2;
class id;
model time1 time2 = id;
repeated time 2 (1 2);
random id /test;
run;
1 1 10 1 100 155 2 1 13 1 122 150 3 1 15 1 132 155 4 1 14 1 125 180 5 1 18 1 150 160 6 1 15 1 140 190 7 1 16 1 130 135 8 1 18 1 142 145 9 1 17 1 115 175 10 1 19 1 118 190 11 2 12 1 55 67 12 2 13 1 85 75 13 2 18 1 45 85 14 2 15 1 52 80 15 2 14 1 38 90 16 2 16 1 47 75 17 2 18 1 80 85 18 2 19 1 45 100 19 2 11 1 35 105 20 2 15 1 25 50 1 1 10 2 100 100 2 1 13 2 122 122 3 1 15 2 132 132 4 1 14 2 125 125 5 1 18 2 150 150 6 1 15 2 140 140 7 1 16 2 130 130 8 1 18 2 142 142 9 1 17 2 115 115 10 1 19 2 118 118 11 2 12 2 55 55 12 2 13 2 85 85 13 2 18 2 45 45 14 2 15 2 52 52 15 2 14 2 38 38 16 2 16 2 47 47 17 2 18 2 80 80 18 2 19 2 45 45 19 2 11 2 35 35 20 2 15 2 25 25
objective 3: Split-plot with experimental/control groups
This is the same as Objective 1, except that you are looking at the dependent variable by sex.
proc glm data=SASUSER.data815;
class SEXcb;
model cb33 cb34 cb35 = SEXcb ;
repeated time 3 ( 1 2 3 ) ;
run;
objective 4: Hierarchical ANOVA
This is NOT a repeated measure design. It is a nested ANOVA. Unfortunately, I do not have meaningful data for you to use right now. However, go ahead and run it with the nonsense variables below. It won't make any sense, but at least you'll get a feel for the format.
Note that like a regular ANOVA, the class statement indicates the independent variables. Also, like a regular ANOVA, the model statement indicates the dependent variables to the left of the equal sign and the independent variables are to the right of the equal sign.
Of course, in this case, we have a nested design. In this case the variable FILOUTBY is nested in AGE.
proc glm data=SASUSER.DATA815;
class FILOUTBY AGE;
model TOTLPROB = FILOUTBY (AGE) ;
run;