Skip to content
Prev 12469 / 20628 Next

sums of squares and F values in anova

Dear Ben,

anova() computes sequential ("type I") tests, so one wouldn't for correlated Xs expect the result to be the same as the "type II" or "type III" tests computed by Anova(), which, however, for an additive model should be the same as each other. You *would* expect the last test in the sequence produced by anova() to be the same as the corresponding type-II or -III test. 

In the case of LMMs fit by lmer(), Anova() computes Wald F-tests using the Kenward-Roger coefficient covariance matrix and Satterthwaite df; for the data/model in your example, that should produce a small difference in the F-statistics.

Here's what I get for your example:

------------- snip ----------
Analysis of Variance Table

Response: sr
          Df Sum Sq Mean Sq F value    Pr(>F)    
pop15      1 204.12 204.118 14.1157 0.0004922 ***
pop75      1  53.34  53.343  3.6889 0.0611255 .  
dpi        1  12.40  12.401  0.8576 0.3593551    
ddpi       1  63.05  63.054  4.3605 0.0424711 *  
Residuals 45 650.71  14.460                      
---
Signif. codes:  0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1
Analysis of Variance Table
      Df  Sum Sq Mean Sq F value
pop15  1 204.118 204.118 14.1157
pop75  1  53.343  53.343  3.6889
dpi    1  12.401  12.401  0.8576
ddpi   1  63.054  63.054  4.3605
Anova Table (Type II tests)

Response: sr
          Sum Sq Df F value   Pr(>F)   
pop15     147.01  1 10.1666 0.002603 **
pop75      35.24  1  2.4367 0.125530   
dpi         1.89  1  0.1309 0.719173   
ddpi       63.05  1  4.3605 0.042471 * 
Residuals 650.71 45 
---
Signif. codes:  0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1
Anova Table (Type III tests)

Response: sr
            Sum Sq Df F value    Pr(>F)    
(Intercept) 218.16  1 15.0867 0.0003338 ***
pop15       147.01  1 10.1666 0.0026030 ** 
pop75        35.24  1  2.4367 0.1255298    
dpi           1.89  1  0.1309 0.7191732    
ddpi         63.05  1  4.3605 0.0424711 *  
Residuals   650.71 45                      
---
Signif. codes:  0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1
Analysis of Deviance Table (Type II Wald chisquare tests)

Response: sr
        Chisq Df Pr(>Chisq)   
pop15 10.1666  1    0.00143 **
pop75  2.4367  1    0.11852   
dpi    0.1309  1    0.71748   
ddpi   4.3605  1    0.03678 * 
---
Signif. codes:  0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1
Loading required package: pbkrtest
Loading required package: MASS
Analysis of Deviance Table (Type II Wald F tests with Kenward-Roger df)

Response: sr
            F Df Df.res  Pr(>F)   
pop15 10.1519  1 44.031 0.00265 **
pop75  2.4326  1 44.036 0.12599   
dpi    0.1245  1 44.811 0.72588   
ddpi   4.2179  1 44.600 0.04589 * 
---                  
Signif. codes:  0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1
Analysis of Deviance Table (Type III Wald F tests with Kenward-Roger df)

Response: sr
                  F Df Df.res    Pr(>F)    
(Intercept) 14.9643  1 44.560 0.0003538 ***
pop15       10.1519  1 44.031 0.0026503 ** 
pop75        2.4326  1 44.036 0.1259919    
dpi          0.1245  1 44.811 0.7258840    
ddpi         4.2179  1 44.600 0.0458898 *  
---
Signif. codes:  0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1

----------------- snip ----------

These results are as expected.

Best,
 John

On Wed, 24 Sep 2014 17:14:31 -0400
Ben Bolker <bbolker at gmail.com> wrote: