different results from ezANOVA and stats aov

86 views
Skip to first unread message

Wiltrud Fassbinder

unread,
Feb 3, 2019, 12:24:21 AM2/3/19
to ez4r
I am getting different results depending on whether I run ezANOVA or stats aov. From looking for comments on that, my sense is that should not happen. So I assume I am doing something in the code, but I can't figure it out:

> ezANOVA (
+   data = NAT_St, 
+   dv = ACC, 
+   wid = .(SubjectID), 
+   within = .(WOC, Length), 
+   return_aov = F
+ )
Warning: Converting "SubjectID" to factor for ANOVA.
$ANOVA
      Effect DFn DFd         F            p p<.05         ges
2        WOC   1  97 84.651636 7.139493e-15     * 0.119711847
3     Length   1  97 45.990808 9.352443e-10     * 0.042665044
4 WOC:Length   1  97  9.177398 3.140336e-03     * 0.009169768

> fit <- aov(ACC ~ WOC*Length + Error(SubjectID/(WOC*Length)), data = NAT_St)
> summary (fit)

Error: SubjectID
          Df Sum Sq Mean Sq F value Pr(>F)
Residuals  1 0.1364  0.1364               

Error: SubjectID:WOC
    Df Sum Sq Mean Sq
WOC  1  5.059   5.059

Error: SubjectID:Length
       Df Sum Sq Mean Sq
Length  1  2.251   2.251

Error: SubjectID:WOC:Length
           Df Sum Sq Mean Sq
WOC:Length  1 0.5691  0.5691

Error: Within
            Df Sum Sq Mean Sq F value   Pr(>F)    
WOC          1   2.71  2.7145  18.347 2.33e-05 ***
Length       1   0.42  0.4248   2.871    0.091 .  
WOC:Length   1   0.04  0.0401   0.271    0.603    
Residuals  384  56.81  0.1480                     
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Mike Lawrence

unread,
Feb 3, 2019, 8:33:52 PM2/3/19
to ez...@googlegroups.com
Hm, try setting return_aov to TRUE and comparing that aov with the by-hand aov you've done.

--
You received this message because you are subscribed to the Google Groups "ez4r" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ez4r+uns...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Wiltrud Fassbinder

unread,
Feb 6, 2019, 9:20:33 PM2/6/19
to ez4r
Another mistake: I had changed the data frame to eliminate subsets of data to balance it, and did not re-factorize the independent variables. Once I did that, the stats code matched ez. 
Reply all
Reply to author
Forward
0 new messages