Exam3.5 | R Documentation |
Exam3.5 fixed location, factorial treatment structure, Gaussian response
Muhammad Yaseen (myaseen208@gmail.com)
Adeela Munawar (adeela.uaf@gmail.com)
Stroup, W. W. (2012). Generalized Linear Mixed Models: Modern Concepts, Methods and Applications. CRC Press.
DataSet3.2
data(DataSet3.2)
DataSet3.2$A <- factor(x = DataSet3.2$A)
DataSet3.2$B <- factor(x = DataSet3.2$B)
DataSet3.2$loc <- factor(x = DataSet3.2$loc, level = c(8, 1, 2, 3, 4, 5, 6, 7))
Exam3.5.lm <- lm(formula = Y~ A + B +loc, data = DataSet3.2)
Exam3.5.lm
##---a0 marginal mean
library(emmeans)
contrast(
object = emmeans(object = Exam3.5.lm, specs = ~ B)
, list(trt = c(1, 0))
)
library(phia)
testFactors(model = Exam3.5.lm, levels = list(B = c("0" = 1,"1" = 0) ))
##---b0 marginal mean
testFactors(model = Exam3.5.lm, levels=list(B = c("0" = 1, "1" = 0)))
##---Simple effect of A on B0
testInteractions(model = Exam3.5.lm, custom = list(B = c("0" = 1,"1" = 0)), across = "B")
##---Simple effect of B on A0
testInteractions(model = Exam3.5.lm, custom = list(A = c("0" = 1, "1" = 0)), across = "A")
##---Simple Effect of A over B
testInteractions(model = Exam3.5.lm, fixed = "A", across = "B")
##---Simple Effect of B over A
testInteractions(model = Exam3.5.lm, fixed = "B", across = "A")
#-------------------------------------------------------------
## Individula least squares treatment means
#-------------------------------------------------------------
emmeans(object = Exam3.5.lm, specs = ~A*B)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.