3. Example:
2-way repeated ANOVA
Source SS df MS F
A A / (S*A)
B B / (S*B)
A*B A*B / (S*A*B)
S
S*A
Error
S*B
S*A*B
4. GLM for repeated measures
data aaa; datalines;
do S= 1 to 3; 5 10 20 10
do A=1 to 2; 6 11 22 13
do B=1 to 2; 4 12 24 9
input x @@; ;
output;
end;
end;
end;
5. GLM for repeated measures:
code
Between Between
ods graphics on; proc glm data=AAA;
proc glm data=AAA class A B S;
plots=intplot; model x=A|B|S;
class A B; test h=A e=A*S;
model x=A|B; test h=B e=B*S;
run; test h=A*B e=A*B*S;
ods graphics off; run;
11. Example
• 16 dogs
• Dependent variable:
– log-histamine concentration
• Independent variables:
– Drug: morphine or trimethaphan (between)
– Depleted: Y or N (between)
– Time: measured after 0, 1, 3, or 5 min (within)
12. Code
data dogs; Morphine Y .07 .07 .06 .07
input Drug $ Depleted $ Histamine0 Histamine1 Morphine Y .05 .07 .06 .07
Histamine3 Histamine5; Trimethaphan N .03 .62 .31 .22
LogHistamine0=log(Histamine0); Trimethaphan N .03 1.05 .73 .60
LogHistamine1=log(Histamine1); Trimethaphan N .07 .83 1.07 .80
LogHistamine3=log(Histamine3); Trimethaphan N .09 3.13 2.06 1.23
LogHistamine5=log(Histamine5); Trimethaphan Y .10 .09 .09 .08
datalines; Trimethaphan Y .08 .09 .09 .10
Morphine N .04 .20 .10 .08 Trimethaphan Y .13 .10 .12 .12
Morphine N .02 .06 .02 .02 Trimethaphan Y .06 .05 .05 .05
Morphine N .07 1.40 .48 .24 ;
Morphine N .17 .57 .35 .24
Morphine Y .10 .09 .13 .14
Morphine Y .12 .11 .10 . Missing data 不用
proc glm; 先寫betwwen,再寫within
class Drug Depleted;
model LogHistamine0--LogHistamine5 =
Drug Depleted Drug*Depleted / nouni;
repeated Time 4 (0 1 3 5) polynomial / summary printe;
run;