[R-lang] aov in R

Zhenguang Cai zhenguangcai@gmail.com
Fri Apr 4 09:50:18 PDT 2014


Hi,

I keep having radically different results for LME (especially when
random slopes are included, due to Barr et al. 2013) between different
versions of R (and supposedly different lme4 packages) (I wonder anyone
else encounter similar problems), so I am turning back to the good old
ANOVA.

I had a repeated measure design, with Perspective as two-level
within-subject factor (Agent vs. Recipient). So I ran an ANOVA analysis
in R, using

aov(Average~Perspective+Error(Subject/Perspective), MT2F1)

and the following are the results

***********************
Error: Subject
Df Sum Sq Mean Sq F value Pr(>F)
Residuals 22 3.176 0.1444

Error: Subject:Perspective
Df Sum Sq Mean Sq F value Pr(>F)
Perspective 1 1.1414 1.1414 37.08 3.96e-06 ***
Residuals 22 0.6772 0.0308
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
*************************

However, I found the F-value was much larger than the F-value (37.08) I
observed in SPSS (5.92) (using the same data set). I wonder whether I
used a wrong formula.

Also, I want to include a covariate "Pnum". I wonder the following is
the correct formula:

aov(Average~(Perspective+Pnum)+Error(Subject/Perspective), MT2F1)

Thanks,

Zhenguang Cai

-- 
Zhenguang Cai

Department of Cogntive, Perceptual and Brain Sciences
University College London

https://sites.google.com/site/zhenguangcai/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucsd.edu/pipermail/ling-r-lang-l/attachments/20140404/bcee00ce/attachment-0001.html 
-------------- next part --------------
Perspective	Subject	Average	Pnum	Average2
A	2	6.8125	6.8125	538.875
A	3	6.625	6.625	540.125
A	4	6.125	6.125	539.8125
A	5	6.4375	6.4375	541.9375
A	6	6.2	6.2	549.8
A	7	6	6	536.9333333
A	8	6.625	6.625	539.75
A	9	6.5625	6.5625	538.6875
A	10	6.125	6.125	539.125
A	11	6.5	6.5	538.875
A	12	6.266666667	6.266666667	539.9333333
A	13	6.8	6.8	540.8666667
A	14	6.125	6.125	538.25
A	15	6.0625	6.0625	538.875
A	16	6.214285714	6.214285714	538.9285714
A	17	6.333333333	6.333333333	541.0666667
A	18	6.066666667	6.066666667	538.1333333
A	19	6.375	6.375	538.25
A	20	6.6875	6.6875	538.1875
A	21	6.6875	6.6875	539.0625
A	22	6.125	6.125	523.6875
A	23	7.6	7.6	535.8
A	24	6.5625	6.5625	536.6875
P	2	6.1875	6.1875	540.625
P	3	6.333333333	6.333333333	540.6
P	4	6.3125	6.3125	536.4375
P	5	6.133333333	6.133333333	541.0666667
P	6	5.933333333	5.933333333	553
P	7	6	6	538.0625
P	8	6.1875	6.1875	538.75
P	9	5.933333333	5.933333333	538.9333333
P	10	6	6	538.1333333
P	11	6.1875	6.1875	538.75
P	12	6.0625	6.0625	540.125
P	13	6	6	542.6666667
P	14	6	6	539.9333333
P	15	6	6	538
P	16	6.090909091	6.090909091	537.6363636
P	17	5.933333333	5.933333333	541.8666667
P	18	6	6	536.6666667
P	19	6.0625	6.0625	538.5
P	20	6.125	6.125	537.3125
P	21	6.266666667	6.266666667	539.9333333
P	22	6	6	530.9375
P	23	6.923076923	6.923076923	535.2307692
P	24	6	6	536.1875


More information about the ling-r-lang-L mailing list