# Contradiction between results of ANOVA and Bonferroni multiple comparison

Here is my model:

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

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?