legacy: Methods for Legacy lmerTest Objects

Description Usage Arguments Author(s) Examples

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
## S3 method for class 'merModLmerTest'
anova(
  object,
  ...,
  type = c("III", "II", "I", "3", "2", "1"),
  ddf = c("Satterthwaite", "Kenward-Roger", "lme4")
)

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

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

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

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

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

## S3 method for class '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.

Author(s)

Rune Haubo B. Christensen

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# 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)

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