PART 2-A
Since this is a mixed effect model where the
Pin elevation factor is the fixed effect factor
release angle is the random effect factor
The model equation can be written as.
\(Y_{ijk}=\mu+\alpha_{i}+\beta_{j}+\alpha\beta_{ij}+\varepsilon_{ijk}\)
where
\(\alpha_{i}\) = Fixed effect of pin elevation
\(\beta_{j}\)= Random effect of release angle
\(\alpha\beta_{ij}\)= Interaction between pin elevation and release angle
\(\epsilon_{ijk}\) ~ \(N(0,\sigma^{2})\)= Random error
MAIN EFFECT HYPOTHESIS ( PIN ELEVATION)
Null hypothesis
\(\alpha_{i}=0\) for all i
Alternative Hypothesis
\(\alpha_{i}\neq 0\) for some i
MAIN EFFECT HYPOTHESIS ( RELEASE ANGLE)
Null Hypothesis
\(\sigma_{\beta}^{2}=0\)
Alternative hypothesis
\(\sigma_{\beta}^{2}\neq 0\) for some j
INTERACTION EFFECT (PIN ELEVATION AND RELEASE ANGLE)
Null hypothesis
\(\sigma^{2}_{\alpha\beta}=0\)
Alternative hypothesis
\(\sigma^{2}_{\alpha\beta}\neq 0\)
Also
I=levels of factor A
J=levels of factor B
K=3
For our design
“1”- pin elevation for Factor A ( bottom most location)
“2”- pin elevation for Factor A ( third position from the bottom most location)
“1”- release angle for factor B - 90 degrees
“2”- release angle for factor B- 110 degrees
“3”- release angle for factor B- 120 degrees
Randomizing the design layout
library(agricolae)
trt<-c(2,3)
seednumber<-123456
design<-design.ab(trt=trt,r=3,design="crd",seed=seednumber)
design$book
## plots r A B
## 1 101 1 2 1
## 2 102 1 1 2
## 3 103 1 1 3
## 4 104 2 1 3
## 5 105 1 2 2
## 6 106 3 1 3
## 7 107 2 2 2
## 8 108 1 1 1
## 9 109 2 1 2
## 10 110 3 1 2
## 11 111 1 2 3
## 12 112 3 2 2
## 13 113 2 1 1
## 14 114 2 2 1
## 15 115 2 2 3
## 16 116 3 1 1
## 17 117 3 2 1
## 18 118 3 2 3
Sample data would be collected above in the randomized order shown
Sample Data collection
dat<-read.csv("part2aa.csv",TRUE,",")
head(dat)
## No plots r A B obs
## 1 1 101 1 2 1 26
## 2 2 102 1 1 2 33
## 3 3 103 1 1 3 22
## 4 4 104 2 1 3 42
## 5 5 105 1 2 2 35
## 6 6 106 3 1 3 39
library(GAD)
dat$A<-as.fixed(dat$A)
dat$B<-as.random(dat$B)
NOTE
A- pin elevation
B- release angle
From the syntax below
model2<-aov(obs~A+B+A*B,data=dat)
GAD::gad(model2)
## Analysis of Variance Table
##
## Response: obs
## Df Sum Sq Mean Sq F value Pr(>F)
## A 1 480.50 480.50 3.0000 0.22540
## B 2 1682.33 841.17 23.2938 7.383e-05 ***
## A:B 2 320.33 160.17 4.4354 0.03613 *
## Residual 12 433.33 36.11
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
FROM THE MODEL TEST
We can see that the p-value of the interaction effect is 0.03613 which is significant at alpha is 0.05. Because of this we are rejecting the null hypothesis and saying that there is significant interaction between A (pin elevation) and B (release angle).
Because we are rejecting the null hypothesis of the higher order effect in this model (interaction effect), we would stop here. We don’t need to check for the significance of the MAIN EFFECTS in this model.
THE INTERACTION PLOT CAN BE VIEWED BELOW
interaction.plot(dat$A,dat$B,dat$obs)
plot(model2)
From the residuals vs Fitted values plot, we see that the spread of the residuals points varies and don’t follow the same spread. This indicates that the constant variance variance assumption is questionable and a further analysis should be done in this case. Because violation of constant variance assumption is a strong one.
We can see a fairly linear trend of the normal qq plot of the residuals indicate that the data have a fair amount of normal distribution.