Flipped Assignment 16

Hypothesis:

\(H_o: \alpha_i = 0\) \(H_a: \alpha_i \neq 0\)

\(H_o: \gamma_k = 0\) \(H_a: \gamma_k \neq 0\)

\(H_o: \delta_l = 0\) \(H_a: \delta_l \neq 0\)

\(H_o: \alpha\gamma_{ik} = 0\) \(H_a: \alpha\gamma_{ik} \neq 0\)

\(H_o: \alpha\delta_{il} = 0\) \(H_a: \alpha\delta_{il} \neq 0\)

A <-c(-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1)
B <-rep(c(-1,-1,1,1),4)
C <-rep(c(-1,-1,-1,-1,1,1,1,1),2)
D <- rep(c(rep(-1,8), rep(1,8)))
obs <-c(12,18,13,16,17,15,20,15,10,25,13,24,19,21,17,23)
mod1<-aov(obs~A*B*C*D)
summary(mod1)
##             Df Sum Sq Mean Sq
## A            1  81.00   81.00
## B            1   1.00    1.00
## C            1  16.00   16.00
## D            1  42.25   42.25
## A:B          1   2.25    2.25
## A:C          1  72.25   72.25
## B:C          1   0.25    0.25
## A:D          1  64.00   64.00
## B:D          1   0.00    0.00
## C:D          1   0.00    0.00
## A:B:C        1   4.00    4.00
## A:B:D        1   2.25    2.25
## A:C:D        1   0.25    0.25
## B:C:D        1   2.25    2.25
## A:B:C:D      1   4.00    4.00
halfnormal(mod1) 
## 
## Significant effects (alpha=0.05, Lenth method):
## [1] A   A:C A:D D

mod2<-aov(obs~A*C+A*D)
summary(mod2)
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## A            1  81.00   81.00  49.846 3.46e-05 ***
## C            1  16.00   16.00   9.846 0.010549 *  
## D            1  42.25   42.25  26.000 0.000465 ***
## A:C          1  72.25   72.25  44.462 5.58e-05 ***
## A:D          1  64.00   64.00  39.385 9.19e-05 ***
## Residuals   10  16.25    1.62                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

After we ran the halfnormal function we removed all insignificant factor and put it into error. This leaves us with only significant factors and interactions.