Exam8.4: Example 8.4 from Generalized Linear Mixed Models: Modern...

Exam8.4R Documentation

Example 8.4 from Generalized Linear Mixed Models: Modern Concepts, Methods and Applications by Walter W. Stroup (p-259)

Description

Exam8.4 Multifactor treatment and Multilevel design structures

Author(s)

  1. Muhammad Yaseen (myaseen208@gmail.com)

  2. Adeela Munawar (adeela.uaf@gmail.com)

References

  1. Stroup, W. W. (2012). Generalized Linear Mixed Models: Modern Concepts, Methods and Applications. CRC Press.

See Also

DataSet8.4

Examples


data(DataSet8.4)
DataSet8.4$block <- factor(x = DataSet8.4$block)
DataSet8.4$a <- factor(x = DataSet8.4$a)
DataSet8.4$b <- factor(x = DataSet8.4$b)

library(lmerTest)
Exam8.4lmer   <-
           lmer(
                y ~ a + b %in% a +
                    (1|block) + (1|block:a) + (1|block:b)
              , data = DataSet8.4
              )
anova(Exam8.4lmer, ddf = "Kenward-Roger")

library(emmeans)
emmeans(object = Exam8.4lmer, specs = ~a|b)

StroupGLMM documentation built on Oct. 2, 2024, 1:07 a.m.