Description Usage Arguments Details Value Author(s) See Also Examples
Compute the multi degrees-of-freedom test in a linear mixed model fitted
by lmer
. The contrast (L) specifies a linear function of the
mean-value parameters, beta. Satterthwaite's method is used to compute the
denominator df for the F-test.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## S3 method for class 'lmerModLmerTest'
contestMD(
model,
L,
rhs = 0,
ddf = c("Satterthwaite", "Kenward-Roger"),
eps = sqrt(.Machine$double.eps),
...
)
calcSatterth(model, L)
## S3 method for class 'lmerMod'
contestMD(
model,
L,
rhs = 0,
ddf = c("Satterthwaite", "Kenward-Roger"),
eps = sqrt(.Machine$double.eps),
...
)
|
model |
a model object fitted with |
L |
a contrast matrix with nrow >= 1 and ncol ==
|
rhs |
right-hand-side of the statistical test, i.e. the hypothesized
value. A numeric vector of length |
ddf |
the method for computing the denominator degrees of freedom and
F-statistics. |
eps |
tolerance on eigenvalues to determine if an eigenvalue is positive. The number of positive eigenvalues determine the rank of L and the numerator df of the F-test. |
... |
currently not used. |
The F-value and associated p-value is for the hypothesis
L β = rhs in which rhs may be non-zero
and β is fixef(model)
.
Note: NumDF = row-rank(L) is determined automatically so row rank-deficient L are allowed. One-dimensional contrasts are also allowed (L has 1 row).
a data.frame
with one row and columns with "Sum Sq"
,
"Mean Sq"
, "F value"
, "NumDF"
(numerator df),
"DenDF"
(denominator df) and "Pr(>F)"
(p-value).
Rune Haubo B. Christensen
contest
for a flexible and
general interface to tests of contrasts among fixed-effect parameters.
contest1D
is a direct interface for
tests of 1-dimensional contrasts.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | data("sleepstudy", package="lme4")
fm <- lmer(Reaction ~ Days + I(Days^2) + (1|Subject) + (0+Days|Subject),
sleepstudy)
# Define 2-df contrast - since L has 2 (linearly independent) rows
# the F-test is on 2 (numerator) df:
L <- rbind(c(0, 1, 0), # Note: ncol(L) == length(fixef(fm))
c(0, 0, 1))
# Make the 2-df F-test of any effect of Days:
contestMD(fm, L)
# Illustrate rhs argument:
contestMD(fm, L, rhs=c(5, .1))
# Make the 1-df F-test of the effect of Days^2:
contestMD(fm, L[2, , drop=FALSE])
# Same test, but now as a t-test instead:
contest1D(fm, L[2, , drop=TRUE])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.