Learn R Programming

lmerTest (version 3.1-3)

anova.merModLmerTest: Methods for Legacy lmerTest Objects

Description

Methods are defined for legacy lmerTest objects of class merModLmerTest generated with lmerTest version < 3.0-0. These methods are defined by interfacing code for lmerModLmerTest methods and therefore behaves like these methods do (which may differ from the behavior of lmerTest version < 3.0-0.)

Usage

# S3 method for merModLmerTest
anova(
  object,
  ...,
  type = c("III", "II", "I", "3", "2", "1"),
  ddf = c("Satterthwaite", "Kenward-Roger", "lme4")
)

# S3 method for merModLmerTest summary(object, ..., ddf = c("Satterthwaite", "Kenward-Roger", "lme4"))

# S3 method for merModLmerTest ls_means( model, which = NULL, level = 0.95, ddf = c("Satterthwaite", "Kenward-Roger"), pairwise = FALSE, ... )

# S3 method for merModLmerTest lsmeansLT( model, which = NULL, level = 0.95, ddf = c("Satterthwaite", "Kenward-Roger"), pairwise = FALSE, ... )

# S3 method for merModLmerTest difflsmeans( model, which = NULL, level = 0.95, ddf = c("Satterthwaite", "Kenward-Roger"), ... )

# S3 method for merModLmerTest drop1( object, scope, ddf = c("Satterthwaite", "Kenward-Roger", "lme4"), force_get_contrasts = FALSE, ... )

# S3 method for merModLmerTest step( object, ddf = c("Satterthwaite", "Kenward-Roger"), alpha.random = 0.1, alpha.fixed = 0.05, reduce.fixed = TRUE, reduce.random = TRUE, keep, ... )

Arguments

object

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

...

for the anova method optionally additional models; for other methods see the corresponding lmerModLmerTest methods for details.

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.

model

a model object fitted with lmer (of class "lmerModLmerTest").

which

optional character vector naming factors for which LS-means should be computed. If NULL (default) LS-means for all factors are computed.

level

confidence level.

pairwise

compute pairwise differences of LS-means instead?

scope

optional character vector naming terms to be dropped from the model. Note that only marginal terms can be dropped. To see which terms are marginal, use drop.scope(terms(object)).

force_get_contrasts

enforce computation of contrast matrices by a method in which the design matrices for full and restricted models are compared.

alpha.random

alpha for random effects elimination

alpha.fixed

alpha for fixed effects elimination

reduce.fixed

reduce fixed effect structure? TRUE by default.

reduce.random

reduce random effect structure? TRUE by default.

keep

an optional character vector of fixed effect terms which should not be considered for eliminated. Valid terms are given by attr(terms(object), "term.labels"). Terms that are marginal to terms in keep will also not be considered for eliminations.

Examples

Run this code
# NOT RUN {
# Load model fits fm1 and fm2 generated with lmerTest version 2.3-37:
load(system.file("testdata","legacy_fits.RData", package="lmerTest"))

# Apply some methods defined by lmerTest:
anova(fm1)
summary(fm1)
contest(fm1, c(0, 1))
contest(fm1, c(0, 1), joint=FALSE)
drop1(fm1)
ranova(fm1)

# lme4-methods also work:
fixef(fm1)

# Ditto for second model fit:
anova(fm2)
summary(fm2)
ls_means(fm2)
difflsmeans(fm2)
# }

Run the code above in your browser using DataLab