anova.lmerModLmerTest: ANOVA Tables for Linear Mixed Models

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/lmer_anova.R

Description

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.

Usage

1
2
3
4
5
6
7
## S3 method for class 'lmerModLmerTest'
anova(
  object,
  ...,
  type = c("III", "II", "I", "3", "2", "1"),
  ddf = c("Satterthwaite", "Kenward-Roger", "lme4")
)

Arguments

object

an lmerModLmerTest object; the result of lmer() after loading the lmerTest-package.

...

potentially additional lmer or lm model objects for comparison of models in which case type and ddf arguments 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 for lmerMod objects as defined in the lme4-package and ignores the type argument. Partial matching is allowed.

Details

The "Kenward-Roger" method calls pbkrtest::KRmodcomp internally and reports scaled F-statistics and associated denominator degrees-of-freedom.

Value

an ANOVA table

Author(s)

Rune Haubo B. Christensen and Alexandra Kuznetsova

See Also

contestMD for multi degree-of-freedom contrast tests and KRmodcomp for the "Kenward-Roger" method.

Examples

1
2
3
4
5
6
7
8
data("sleepstudy", package="lme4")
m <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
anova(m) # with p-values from F-tests using Satterthwaite's denominator df
anova(m, ddf="lme4") # no p-values

# Use the Kenward-Roger method
if(requireNamespace("pbkrtest", quietly = TRUE))
  anova(m, ddf="Kenward-Roger")

lmerTest documentation built on Oct. 23, 2020, 6:16 p.m.