Description Details Value See Also Examples
Fit a linear mixed model
This lmer
function is an overloaded function of lmer
(merMod
class from lme4 package).
An object of class "merModLmerTest"
merModLmerTest
class
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 | library(lmerTest)
## linear mixed models
fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
fm2 <- lmer(Reaction ~ Days + (1|Subject) + (0+Days|Subject), sleepstudy)
# anova table the same as of class merMod but with additional F statistics and
# p-values calculated based on Satterthwaite's approximations
anova(fm1)
# anova table the same as of class merMod but with additional F statistics and
# p-values calculated based on Kenward-Roger's approximations
## Not run:
if(requireNamespace("pbkrtest", quietly = TRUE))
anova(fm1, ddf="Kenward-Roger")
# anova table the same as of class merMod
anova(fm1, ddf="lme4")
## End(Not run)
# gives summary of merModLmerTest class. The same as of class merMod but with
# additional p-values calculated based on Satterthwate's approximations
summary(fm1)
## multiple comparisons statistics. The one from lme4 package
## Not run:
anova(fm1, fm2)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.