Exam8.1: Example 8.1 from Generalized Linear Mixed Models: Modern...

Exam8.1R Documentation

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

Description

Exam8.1 Nested factorial structure

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

Examples


data(DataSet8.1)
DataSet8.1$block <- factor(x = DataSet8.1$block)
DataSet8.1$set <- factor(x = DataSet8.1$set)
DataSet8.1$trt <- factor(x = DataSet8.1$trt)

library(lmerTest)
Exam8.1Lmer <- lmer(y ~ set + trt %in% set + (1|set/block), DataSet8.1)
summary(Exam8.1Lmer)
anova(Exam8.1Lmer)

library(emmeans)
emmeans(object  = Exam8.1Lmer, specs = ~trt|set)
contrast(emmeans(object  = Exam8.1Lmer, specs = ~trt|set), method = "pairwise", by = "set")


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