Question 5.2

P-value A

#qf(0.95, 1, 15)

pf(0.000010, 1, 15, lower.tail = FALSE)
## [1] 0.9975185

P-value B

#qf(0.95, 3, 15)

pf(3.02917, 3, 15, lower.tail = FALSE)
## [1] 0.06220712

P-value Interaction

#qf(0.95, 3, 15)

pf(0.14237, 3, 15, lower.tail = FALSE)
## [1] 0.9329697

Question 5.9

library(agricolae)
#?design.ab
trts<-c(2,4)
design<-design.ab(trt=trts, r=2, design="crd",seed=878900)
experiment<-design$book

speed<-c(2.45,2.49,2.60,2.94,2.85,2.88,2.75,2.86,2.72,2.86,2.83,2.80,2.87,2.70,2.78,2.83)
experiment$A<-as.factor(experiment$A)
experiment$B<-as.factor(experiment$B)
str(experiment)
## 'data.frame':    16 obs. of  4 variables:
##  $ plots: num  101 102 103 104 105 106 107 108 109 110 ...
##  $ r    : int  1 2 1 1 1 2 1 2 2 1 ...
##  $ A    : Factor w/ 2 levels "1","2": 1 1 1 2 2 2 1 1 1 2 ...
##  $ B    : Factor w/ 4 levels "1","2","3","4": 2 2 3 4 2 4 4 4 3 3 ...

Test Hypothesis

Ho: \(\alpha \beta_{ij} = 0\) - Null Hypothesis

Ha: \(\alpha \beta_{ij} \ne 0\) - Alternative Hypothesis

Ho: \(\alpha_{i} = 0\) - Null Hypothesis

Ha: \(\alpha_{i} \ne 0\) - Alternative Hypothesis

Ho: \(\beta_{j} = 0\) - Null Hypothesis

Ha: \(\beta_{j} \ne 0\) - Alternative Hypothesis

\(\alpha\) = 0.05

Linear Effects

\(y_{ij} = \mu + \alpha_{i} + \beta_j + \alpha \beta_{ij} + \epsilon_{ij}\)

model<-aov(speed~A*B, data = experiment)
summary(model)
##             Df  Sum Sq Mean Sq F value   Pr(>F)    
## A            1 0.14251 0.14251  56.022 7.03e-05 ***
## B            3 0.09102 0.03034  11.927  0.00253 ** 
## A:B          3 0.04467 0.01489   5.853  0.02044 *  
## Residuals    8 0.02035 0.00254                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Conclusion

First we test the interaction hypothesis and if we fail to reject Ho, then we can test the hypothesis of the main effects. From the result /fo/ is 5.853 with a corresponding p-value of 0.02044 < \(\alpha\) = 0.05 is statistically significant. Therefore we reject Ho that the means are equal.

interaction.plot(experiment$B,experiment$A,speed,type = "l",col = 1:2, trace.label = "Speed rate", ylab = "Force",xlab = "Feed rate",main ="Thrust Force Interraction Plot")

The interaction plot shows that there is no interaction between Factor A and Factor B. However the distance between the plots at various levels of Factor A appears to show that the thrust force developed by the drill press in the experiment is affected by the level of feed rate at different speeds.

#**Question 5.2**
pf(0.000010, 1, 15, lower.tail = FALSE)
pf(3.02917, 3, 15, lower.tail = FALSE)
pf(0.14237, 3, 15, lower.tail = FALSE)

#**Question 5.2**
trts<-c(2,4)
design<-design.ab(trt=trts, r=2, design="crd",seed=878900)
experiment<-design$book

speed<-c(2.45,2.49,2.60,2.94,2.85,2.88,2.75,2.86,2.72,2.86,2.83,2.80,2.87,2.70,2.78,2.83)
experiment$A<-as.factor(experiment$A)
experiment$B<-as.factor(experiment$B)
str(experiment)


model<-aov(speed~A*B, data = experiment)
summary(model)


interaction.plot(experiment$B,experiment$A,speed,type = "l",col = 1:2, trace.label = "Speed rate", ylab = "Force",xlab = "Feed rate",main ="Thrust Force Interraction Plot")