Here is my model:

anova_price <- Anova(lm(df1$Price ~ df1$Clarity + df1$Colour + df1$Certification),type = 3)

Anova Table (Type III tests)

Response: df1$Price
                      Sum Sq  Df F value    Pr(>F)    
(Intercept)        502073518   1 61.2424  9.01e-14 ***
df1$Clarity         34957402   4  1.0660  0.373493    
df1$Colour         128190641   5  3.1273  0.009101 ** 
df1$Certification  724489324   2 44.1863 < 2.2e-16 ***
Residuals         2426646525 296                      
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

We see, that df1$Clarity is insignificant and in case of type 3 ANOVA it means, that 0 variation can be accounted to df1$Clarity if we include other factors. So - there is no difference between groups df1$Clarity in price.

Here I decide to double check it by Bonferroni multiple comparison:

pairwise.t.test(x = df1$Price, g = df1$Clarity,p.adjust.method = 'bonferroni')

    Pairwise comparisons using t tests with pooled SD 

data:  df1$Price and df1$Clarity 

     IF      VS1     VS2     VVS1   
VS1  0.00145 -       -       -      
VS2  3.4e-05 1.00000 -       -      
VVS1 0.00025 1.00000 1.00000 -      
VVS2 0.00022 1.00000 1.00000 1.00000

But here we see, that differences between some of groups exist!

So which of the test is it correct? Or maybe I did something wrong?


This is not typical but not particularly uncommon. The tests do not contradict each other unless you accept the null hypothesis when you do not reject it. The best practice is to plan your analytic strategy in advance. One reasonable plan would be to do mean comparisons only if the ANOVA effect is significant. Another would to plan a priori do the mean comparisons without doing the ANOVA as long as the mean comparisons are done with a method that controls the Type I error (as you did). However, doing an ANOVA and testing mean differences regardless of the ANOVA result inflates the Type I error.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.