1 3.23

#reading the data
ft1 <- c(17.6,18.9,16.3,17.4,20.1,21.6)
ft2 <- c(16.9,15.3,18.6,17.1,19.5,20.3)
ft3 <- c(21.4,23.6,19.4,18.5,20.5,22.3)
ft4 <- c(19.3,21.1,16.9,17.5,18.3,19.8)
data <- as.data.frame(cbind(ft1,ft2,ft3,ft4))
stacked_data <- stack(data)

1.1 a)

model <- aov(values~ind,data = stacked_data)
summary(model)
##             Df Sum Sq Mean Sq F value Pr(>F)  
## ind          3  30.17   10.05   3.047 0.0525 .
## Residuals   20  65.99    3.30                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

As the resulted p-value is 0.0525, we cant reject the null hypothesis (all means being equal).

1.2 b)

summary(data)
##       ft1             ft2             ft3             ft4       
##  Min.   :16.30   Min.   :15.30   Min.   :18.50   Min.   :16.90  
##  1st Qu.:17.45   1st Qu.:16.95   1st Qu.:19.68   1st Qu.:17.70  
##  Median :18.25   Median :17.85   Median :20.95   Median :18.80  
##  Mean   :18.65   Mean   :17.95   Mean   :20.95   Mean   :18.82  
##  3rd Qu.:19.80   3rd Qu.:19.27   3rd Qu.:22.07   3rd Qu.:19.68  
##  Max.   :21.60   Max.   :20.30   Max.   :23.60   Max.   :21.10

As shown in the summary of the data, mean, median as well as all quadrant values of fluid type 3 is higher than other fluid types. Therefore, if the objective is long life, I will choose fluid type 3.

1.3 c)

plot(model)

By a visual inspection of these figures, we can see that the data seems to have a normal distribution (second figure) and have constant variance (last figure).

2 3.28

#reading the data
m1 <- c(110,157,194,178)
m2 <- c(1,2,4,18)
m3 <- c(880,1256,5276,4355)
m4 <- c(495,7040,5307,10,050)
m5 <- c(7,5,29,2)
data1 <- as.data.frame(cbind(m1,m2,m3,m4,m5))
stacked_data1 <- stack(data1)

2.1 a)

model1 <- aov(values~ind,data = stacked_data1)
summary(model1)
##             Df   Sum Sq Mean Sq F value Pr(>F)  
## ind          4 37570963 9392741       3 0.0432 *
## Residuals   20 62627016 3131351                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Since the calculated p-value (0.0432) is lower than alpha (0.05), we can reject the null hypothesis. Meaning not all the means are equal.

2.2 b)

plot(model1)

As illustrated in the figures, neither the constant variance nor the normality assumption seems to be satisfied here.

2.3 c)

kruskal.test(values~ind,data = stacked_data1)
## 
##  Kruskal-Wallis rank sum test
## 
## data:  values by ind
## Kruskal-Wallis chi-squared = 18.466, df = 4, p-value = 0.001001

As the ANOVA assumption may not be satisfied here, we need to use a non-parametric test. As the results of this test has shown, we can still reject the null hypothesis with the specified alpha.

3 3.29

#reading data
mt1 <- c(31,10,21,4,1)
mt2 <- c(62,40,24,30,35)
mt3 <- c(53,27,120,97,68)
data2 <- as.data.frame(cbind(mt1,mt2,mt3))
stacked_data2 <- stack(data2)

3.1 a)

model2 <- aov(values~ind,data = stacked_data2)
summary(model2)
##             Df Sum Sq Mean Sq F value  Pr(>F)   
## ind          2   8964    4482   7.914 0.00643 **
## Residuals   12   6796     566                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

We have tested, whether or not all methods have the same effect on mean particle count. As the p-value is lower than 0.05, we can say that not all methods have the same effect on mean particle count.

3.2 b)

plot(model2)

Based on these figures, it seems that normality and constant variance assumptions are not satisfied.

3.3 c)

kruskal.test(values~ind,data = stacked_data2)
## 
##  Kruskal-Wallis rank sum test
## 
## data:  values by ind
## Kruskal-Wallis chi-squared = 8.54, df = 2, p-value = 0.01398

Since the ANOVA assumption are not satisfied here, we need to use a non-parametric method to test our hypothesis. Results the Kruskal-Wallis test still agree with the previous ANOVA results and we still can reject the null hypothesis with alpha=0.05.

4 3.51

kruskal.test(values~ind,data = stacked_data)
## 
##  Kruskal-Wallis rank sum test
## 
## data:  values by ind
## Kruskal-Wallis chi-squared = 6.2177, df = 3, p-value = 0.1015

Results of the ANOVA in the question 3.23 showed a p-value of 0.525. By changing our testing method to Kruskal-Wallis, the p-value have increased to 0.1015. However, in neither case we were able to reject the null hypothesis with alpha=0.05.

5 3.52

kruskal.test(values~ind,data = stacked_data)
## 
##  Kruskal-Wallis rank sum test
## 
## data:  values by ind
## Kruskal-Wallis chi-squared = 6.2177, df = 3, p-value = 0.1015

Results of the ANOVA in the question 3.23 showed a p-value of 0.525. By changing our testing method to Kruskal-Wallis, the p-value have increased to 0.1015. However, in neither case we were able to reject the null hypothesis with alpha=0.05.