Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jcochero opened this issue Aug 21, 2020 · 2 comments
Open

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

jcochero opened this issue Aug 21, 2020 · 2 comments

Comments

@jcochero
Copy link

jcochero commented Aug 21, 2020

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
Copy link
Owner

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants