# [S] output of summary.aov for repeated measure design

Gabriel Baud-Bovy (baudbovy@fpshp1.unige.ch)
Sat, 11 Apr 98 16:29:16 +0200

Dear Subscribers,

I am using Unix S+ 3.4 and I have some problems to interpret
the output of the summary function for an ANOVA with a
repeated measure design. In order to test the effect
of the factors pa,sp,dir and their interaction on the
on the experiment), I used (let me know if the formula
is not correct):

>summary(aov(fxy~pa*sp*dir+Error(su/(pa*sp*dir)),data=dat))

The summary gives 2 lines for each one of the Error term used in
the formula (see below). If I understand well, the first line tests
the main effect or the interaction corresponding to the label given
in the first column (the df corresponds to the number of level minus 1).
But what hypothesis is being tested in the second line (the df is
always equal to 1)? I do not understand the label of this line.
Besides, I do not understand the df of the error term being used
in these tests. For example, the F used to test the significance of
factor "pa" is:

(61.4074/1)/(698.5582/8)=0.703

but in fact, it should be:

(SS(pa)/df(pa))/(SS(pa:su)/df(pa:su))=(61.561/1)/(698.624/9)=0.793

note: the difference in the Sum of Sq is probably just a rounding error.

Gabriel Baud-Bovy

PS: When testing for a single effect, this problem does not appear.
For example,

summary(aov(fxy=pa+Error(su/pa),data=dat))

gives what I beleive to be the correct test (see below).

----------------------------------------------

>summary(aov(fxy~pa*sp*dir*su,data=dat))

Df Sum of Sq Mean Sq F Value Pr(F)
pa 1 61.561 61.5611 210.0354 0.0000000000
sp 4 521.291 130.3228 444.6381 0.0000000000
dir 1 23.092 23.0924 78.7873 0.0000000000
su 9 2339.128 259.9031 886.7433 0.0000000000
pa:sp 4 5.675 1.4189 4.8409 0.0006899756
pa:dir 1 17.643 17.6429 60.1945 0.0000000000
sp:dir 4 21.236 5.3090 18.1133 0.0000000000
pa:su 9 698.624 77.6249 264.8425 0.0000000000
sp:su 36 378.600 10.5167 35.8810 0.0000000000
dir:su 9 95.988 10.6653 36.3882 0.0000000000
pa:sp:dir 4 8.565 2.1412 7.3053 0.0000076650
pa:sp:su 36 94.494 2.6248 8.9554 0.0000000000
pa:dir:su 9 13.959 1.5510 5.2917 0.0000003614
sp:dir:su 36 34.494 0.9582 3.2691 0.0000000003
pa:sp:dir:su 36 29.015 0.8060 2.7499 0.0000001384
Residuals 2199 644.524 0.2931

----------------------------------------------------------------

>summary(aov(fxy~pa+Error(su/pa),data=dat))

Error: su
Df Sum of Sq Mean Sq F Value Pr(F)
pa 1 61.245 61.2452 0.2150754 0.6551754 <-?
Residuals 8 2278.091 284.7614

Error: pa %in% su
Df Sum of Sq Mean Sq F Value Pr(F)
pa 1 61.4074 61.40737 0.7910793 0.3969244 <- ok
Residuals 9 698.6231 77.62479

Error: Within
Df Sum of Sq Mean Sq F Value Pr(F)
Residuals 2379 1888.522 0.79383

---------------------------------------------------------------

>summary(aov(fxy~pa*sp*dir+Error(su/(pa*sp*dir)),data=dat))

Error: su
Df Sum of Sq Mean Sq F Value Pr(F)
pa 1 61.245 61.2452 0.2150754 0.6551754 <- ?
Residuals 8 2278.091 284.7614

Error: pa %in% su
Df Sum of Sq Mean Sq F Value Pr(F)
pa 1 61.4074 61.40737 0.703247 0.4260401 <- df=2-1
sp 1 0.0649 0.06488 0.000743 0.9789210 <- ?
Residuals 8 698.5582 87.31978 <- df=10-2?

Error: sp %in% su
Df Sum of Sq Mean Sq F Value Pr(F)
sp 4 521.3291 130.3323 12.27920 0.0000024 <- ok: df=5-1
dir 1 7.0530 7.0530 0.66449 0.4204913b <- ?
Residuals 35 371.4923 10.6141

Error: dir %in% su
Df Sum of Sq Mean Sq F Value Pr(F)
dir 1 23.06633 23.06633 1.925644 0.2026627
pa:sp 1 0.16080 0.16080 0.013424 0.9106186 <- ?
Residuals 8 95.82800 11.97850

Error: pa:sp %in% su
Df Sum of Sq Mean Sq F Value Pr(F)
pa:sp 4 5.65689 1.414223 0.5273364 0.7163345
pa:dir 1 0.63646 0.636463 0.2373245 0.6291825 <- ?
Residuals 35 93.86384 2.681824

Error: pa:dir %in% su
Df Sum of Sq Mean Sq F Value Pr(F)
pa:dir 1 17.59651 17.59651 16.61767 0.00355142 <- df=(2-1)(2-1)
sp:dir 1 5.52343 5.52343 5.21618 0.05175573 <- ?
Residuals 8 8.47123 1.05890

Error: sp:dir %in% su
Df Sum of Sq Mean Sq F Value Pr(F)
sp:dir 4 21.25844 5.314611 5.671531 0.0012563 <- df=(5-1)(2-1)
pa:sp:dir 1 1.70435 1.704347 1.818808 0.1861176 <- ?
Residuals 35 32.79739 0.937068

Error: pa:sp:dir %in% su
Df Sum of Sq Mean Sq F Value Pr(F)
pa:sp:dir 4 8.54463 2.136158 2.650375 0.04890801
Residuals 36 29.01540 0.805983

Error: Within
Df Sum of Sq Mean Sq F Value Pr(F)
Residuals 2199 644.5236 0.2930985

Description of the experiment: a robot produced laterally oriented
point-to-point movements. The trajectories resulted from
the combination of 2 possible paths (straight line or arc
of circle) and 5 velocity profiles. Subjects grasped the handle
mounted on the extremity of the robotic arm and were
instructed to follow the movement as well as possible.
The force applied by the subject's hand to the handle was
recorded during the movements. For each subject, there were 10
blocks of 24 movements (12 left-to-right and 12 right-to-left
movements). All movements in one block were identical (same
path and velocity profile).

Description of the dataframe:
fxy: average length of the force vector during the movement
su: subjects (10-levels factor)
st: movement type (20-levels factor=2*5*2)
pa: paths (2-levels factor)
sp: velocity profiles (5 levels factor)
dir: movement direction (2 levels factor)
n: repetitions (12 levels factor)
note: the dataframe has 10*20*12=2400 rows.

-------------------------------------------------------------
Gabriel Baud-Bovy baudbovy@fpshp1.unige.ch
Université de Genève, FAPSE tel. +41 22 705 97 67
9, route de Drize fax +41 22 300 14 82
1227 Carouge, Switzerland home tel. +41 22 320 21 38
-------------------------------------------------------------

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news