ANOVA table with F-tests and p-values using Satterthwaite's or
Kenward-Roger's method for denominator degrees-of-freedom and F-statistic.
Models should be fitted with
lmer from the lmerTest-package.
Arguments
- object
an
lmerModLmerTestobject; the result oflmer()after loading the lmerTest-package.- ...
potentially additional
lmerorlmmodel objects for comparison of models in which casetypeandddfarguments are ignored.- type
the type of ANOVA table requested (using SAS terminology) with Type I being the familiar sequential ANOVA table.
- ddf
the method for computing the denominator degrees of freedom and F-statistics.
ddf="Satterthwaite"(default) uses Satterthwaite's method;ddf="Kenward-Roger"uses Kenward-Roger's method,ddf = "lme4"returns the lme4-anova table, i.e., using the anova method forlmerModobjects as defined in the lme4-package and ignores thetypeargument. Partial matching is allowed.
Details
The "Kenward-Roger" method calls pbkrtest::KRmodcomp internally and
reports scaled F-statistics and associated denominator degrees-of-freedom.
Examples
data("sleepstudy", package="lme4")
m <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
anova(m) # with p-values from F-tests using Satterthwaite's denominator df
#> Type III Analysis of Variance Table with Satterthwaite's method
#> Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
#> Days 30031 30031 1 17 45.853 3.264e-06 ***
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
anova(m, ddf="lme4") # no p-values
#> Analysis of Variance Table
#> npar Sum Sq Mean Sq F value
#> Days 1 30031 30031 45.853
# Use the Kenward-Roger method
if(requireNamespace("pbkrtest", quietly = TRUE))
anova(m, ddf="Kenward-Roger")
#> Type III Analysis of Variance Table with Kenward-Roger's method
#> Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
#> Days 30031 30031 1 17 45.853 3.264e-06 ***
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1