library(readxl)
dat<-read_excel("/Users/nabinwon/Downloads/nonParametric.xlsx")
Null Hypothesis: There is no difference between the average of Group A and Group B.
Alternative Hypothesis: There is a difference between the average of Group A and Group B.
par(mfrow=c(1,2))
hist(dat$groupA,main="Group A")
hist(dat$groupB,main="Group B")
From the two histograms, one can conclude that both Group A and Group do not follow the normal distribution, as both of the graphs are visibly skewed to the left.
shapiro.test(dat$groupA)
##
## Shapiro-Wilk normality test
##
## data: dat$groupA
## W = 0.87756, p-value = 0.0002036
shapiro.test(dat$groupB)
##
## Shapiro-Wilk normality test
##
## data: dat$groupB
## W = 0.87586, p-value = 0.0001823
The p-values for both Group A and Group B are smaller than 0.05 (significance level), thus signifiying that both data sets do not follow the normal distribution.
result<- wilcox.test(dat$groupA,dat$groupB, paired=FALSE)
## Warning in wilcox.test.default(dat$groupA, dat$groupB, paired = FALSE): cannot
## compute exact p-value with ties
print(result)
##
## Wilcoxon rank sum test with continuity correction
##
## data: dat$groupA and dat$groupB
## W = 1065.5, p-value = 0.6718
## alternative hypothesis: true location shift is not equal to 0
The p-value derived from the Mann-Whitney U Test is 0.6718, which is greater than the significance level of 0.05. Therefore, we can conclude that the true location shift is equal to 0.