VST and Kruskal-Wallace Assignment

a.) Yij= u+Ti+Ej i=1,…4 j=1,…6

Ho= T1=T2=T3=T4 Ha= One or more differs

b.) It appear after observing the data that the data is normality and has constant varience. However, there is a slight shift in the data based on the variety.

c.)Based on the data analysis, the p<.0001, and the F is apporx, 76.29.

#d.)
library(MASS)
bc<-boxcox(y~grp)

lambda<-boxcox(y~grp, plotit=FALSE)$x[which.max(boxcox(y~grp, plotit=FALSE)$y)]
lambda
## [1] 0.5
y_t<-if(abs(lambda)<1e-6) log(y) else(y^lambda-1)/lambda
fit_bc<-aov(y_t~grp)
summary(fit_bc)
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## grp          3 130.78   43.59   81.17 2.27e-11 ***
## Residuals   20  10.74    0.54                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
par(mfrow=c(1,2)); plot(fit_bc, which=1); qqnorm(resid(fit_bc));qqline(resid(fit_bc))

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

We reject the Ho. The H statistic is 21.16, with a df of 3 and a pval- 9.8e^-5. This is due to the fact that based on the data, the values differ enough to reject the null hypothesis.

R Markdown