Learn R Programming

StroupGLMM (version 0.3.0)

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

Arguments

Author

  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

Run this code

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")

Run the code above in your browser using DataLab