dstanley4 / apaTables

Development version of apaTables R package. Current stable version is on the CRAN.
http://dstanley4.github.io/apaTables/
Other
55 stars 13 forks source link

Different results between summary() and apa.aov.table() #30

Open jcochero opened 4 years ago

jcochero commented 4 years ago

Hi everyone! Why do I get different results between summary() and the output from apa.aov.table? Different sum squares, p values, etc. Thanks in advance!

Example using goggles lm_output <- aov(attractiveness ~ gender*alcohol, data = goggles) summary(lm_output) apa.aov.table(lm_output, filename = "table_APA.doc")

dstanley4 commented 4 years ago

APA tables uses Type III Sum of Squares - as per SPSS. See details to reproduce numbers below: David

1) Predictors must be factors

2) Set Helmert Contrast

3) Use Type III sum of squares via Anova from car package

4) Use lm not aov

library(apaTables) library(car)

options(contrasts = c("contr.helmert", "contr.poly"))

lm_output <- lm(attractiveness ~ gender*alcohol, data = goggles)

Anova(lm_output, type = 3) apa.aov.table(lm_output)

See http://www.statscanbefun.com/rblog/2015/8/27/ensuring-r-generates-the-same-anova-f-values-as-spss

jcochero commented 4 years ago

Thank you so much @dstanley4, I see the difference now. Great work, love apaTables!