library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(tidyr)
method1<-c(0.34,0.12,1.23,0.70,1.75,0.12)
method2<-c(0.91,2.94,2.14,2.36,2.86,4.55)
method3<-c(6.31,8.37,9.75,6.09,9.82,7.24)
method4<-c(17.15,11.82,10.97,17.20,14.35,16.82)
questiona<-cbind.data.frame(method1,method2,method3,method4)

dat<-pivot_longer(questiona, c(method1,method2,method3,method4))

Part a:

Linear Effects Equation:

x(ij) = u + t(i) + E(ij)

Hypothesis:

\(H_o: \tau_i = 0\) for all i

\(H_a: \tau_i \neq 0\) for some i

Part b:

qqnorm(dat$value)

boxplot(method1,method2,method3,method4)

After running a normal probability plot we conclude that the data is approximately normally distributed. It is important to note that we do not have an adequate amoutn of data to properly asses the normality of the data. However, after running a boxplot, we can not conclude that the variances are equal.

Part c:

kruskal.test(value~name, data = dat)
## 
##  Kruskal-Wallis rank sum test
## 
## data:  value by name
## Kruskal-Wallis chi-squared = 21.156, df = 3, p-value = 9.771e-05

Our pvalue is 9.771e-05. This is significantly less than 0.05. Therefore we reject the null hypothesis.

Part d:

library(MASS)
## 
## Attaching package: 'MASS'
## The following object is masked from 'package:dplyr':
## 
##     select
library(dplyr)
boxcox(value~name, data=dat)

lambda = 0.6
dat2<-dat$value^(lambda)
dat2<-cbind(dat$name, dat2)
dat2<-as.data.frame(dat2)
boxcox(dat2~dat$name, data=dat2)

We can see that the value of lamda is near to 1 after performing boxcox transformation

model<-aov(dat2~dat$name,data=dat2)
summary(model)
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## dat$name     3  63.71  21.236   85.76 1.36e-11 ***
## Residuals   20   4.95   0.248                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

The p-value we calculated is 1.36e-11. This is less than our alpha which mean we reject the null Hypothesis.