I was doing ANOVA in SPSS and then in R and to my huge surprise, the results from the latest version of R were incorrect.
When I use the function model.tables(x,"means") to get descriptive statistics, the independent variable means by the second dependent are slightly incorrect (e.g. 129 instead of 130.27).
My question is what could cause the problem? I am a novice to R but using the same data, SPSS gets the result correctly, so something is obviously wrong.
head(data):
skupina pohlavie zodpovedny
1 1 1 152
2 1 1 118
3 2 2 88
4 2 1 140
Code:
x <- aov(zodpovedny ~ pohlavie*skupina,data=data)
model.tables(x,"means")
Problem illustrated:

zodpovednyvalues are indeed integers from an interval [0,200] and when I use themean()function independently, R returns the correct value of 130.2692 instead of 129. Additionally, when I switch the formula frompohlavie*skupinatoskupina*pohlavie, values forpohlavieare correct while values forskupinaare not. Interestingly, as I have made many trials and restarted R a few times during the process, it even returned 141.88 instead of the former and correct 141.9. – Harold Cavendish Dec 14 '12 at 0:03