QUESTION A:

Linear Effects Equation:

\(\\Y_{ij}=\mu +\tau_{ij}+\epsilon_{ij}\)

Hypothesis Testing:

\(H_0 :τ_1 =τ_2 =τ_3 =τ_4 =0\) (all mean discharges equal)

\(H_a : τ_I \neq 0\) (at least 1)

Observations<-c(0.34,0.12,1.23,0.70,1.75,0.12,0.91,2.94,2.14,2.36,2.86,4.55,6.31,8.37,9.75,6.09,9.82,7.24,17.15,11.82,10.97,17.20,14.35,16.82)
factor<-c(rep(1,6),rep(2,6),rep(3,6),rep(4,6))
df<-data.frame(factor,Observations)

QUESTION B:

To determine the normality, we need to view the box-plot of the data.

boxplot(Observations~factor, col="red")

COMMENT: Based on the data provided, the sizes of the box-plots differs, hence this shows the variance of the data is different.

QUESTION C:

Untransformed Data: Parametric fit using ANOVA

model<-aov(Observations~factor,data=df)
summary(model)
##             Df Sum Sq Mean Sq F value  Pr(>F)    
## factor       1  672.0   672.0   149.9 2.7e-11 ***
## Residuals   22   98.6     4.5                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(model, col= "blue")

COMMENT: Based on the residual plot, we can see that the data produces a lot of spread. The Normal Probabilty Plot is not viable to use for the analysis.

QUESTION D:

Box Cox Transformation: We have to transform the data and use lambda as 0.5 to perform the operation.

library(MASS)
boxcox(Observations~factor,data=df)

trans_Observations<-(sqrt(Observations)-1)/.5

COMMENT: After the transformation, we determine that the variance of the data are similar to each other.

QUESTION E:

Kruskal-Wallace non-parametric test:

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

COMMENT: After performing the test, the p-value was less than 0.05, hence we reject \(H_0\)

COMPLETE CODE:

Observations<-c(0.34,0.12,1.23,0.70,1.75,0.12,0.91,2.94,2.14,2.36,2.86,4.55,6.31,8.37,9.75,6.09,9.82,7.24,17.15,11.82,10.97,17.20,14.35,16.82)
factor<-c(rep(1,6),rep(2,6),rep(3,6),rep(4,6))
df<-data.frame(factor,Observations)
boxplot(Observations~factor, col="red")
model<-aov(Observations~factor,data=df)
summary(model)
plot(model, col= "blue")
library(MASS)
boxcox(Observations~factor,data=df)
trans_Observations<-(sqrt(Observations)-1)/.5
kruskal.test(Observations~factor, data = df)