Exam8.2: Example 8.2 from Generalized Linear Mixed Models: Modern...

Exam8.2R Documentation

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

Description

Exam8.2 Incomplete strip-plot

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.2

Examples


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

library(lmerTest)

Exam8.2lmer <-
          lmer(
                 formula = y ~ a*b + (1|block) + (1|block:a) + (1|block:b)
               , data    = DataSet8.2
               )
anova(Exam8.2lmer,ddf="Kenward-Roger")

library(emmeans)
emmeans(object  = Exam8.2lmer, specs = ~a|b)
emmip(
       object  = emmeans(object  = Exam8.2lmer, specs = ~a|b)
     , formula = a~b
     , ylab    = "y Lsmeans"
     , main    = "Lsmeans for a*b"
      )

##---Simple effect comparisons of a*b Least Squares Means by a ( page # 254)
emmeans(Exam8.2lmer, pairwise ~ b|a)



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