Exam2.B.5 | R Documentation |
Exam2.B.5 is related to multi batch regression data assuming different forms of linear models.
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.
Table1.2
#-----------------------------------------------------------------------------------
## Nested Model with no intercept
#-----------------------------------------------------------------------------------
data(Table1.2)
Table1.2$Batch <- factor(x = Table1.2$Batch)
Exam2.B.5.lm1 <- lm(formula = Y ~ 0 + Batch + Batch/X, data = Table1.2)
DesignMatrix.lm1 <- model.matrix (object = Exam2.B.5.lm1)
DesignMatrix.lm1
#-----------------------------------------------------------------------------------
## Interaction Model with intercept
#-----------------------------------------------------------------------------------
Exam2.B.5.lm2 <-lm(formula = Y ~ Batch + X + Batch*X, data = Table1.2)
DesignMatrix.lm2 <- model.matrix (object = Exam2.B.5.lm2)
DesignMatrix.lm2
#-----------------------------------------------------------------------------------
## Interaction Model with no intercept
#-----------------------------------------------------------------------------------
Exam2.B.5.lm3 <- lm(formula = Y ~ 0 + Batch + Batch*X, data = Table1.2)
DesignMatrix.lm3 <- model.matrix(object = Exam2.B.5.lm3)
DesignMatrix.lm3
#-----------------------------------------------------------------------------------
## Interaction Model with intercept but omitting X term as main effect
#-----------------------------------------------------------------------------------
Exam2.B.5.lm4 <- lm(formula = Y ~ Batch + Batch*X, data = Table1.2)
DesignMatrix.lm4 <- model.matrix(object = Exam2.B.5.lm4)
DesignMatrix.lm4
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.