t7q3 = read.table("C:/Users/Wei Hao/Desktop/ST2137/Tutorials/Data/batfail.txt", header=T)
attach(t7q3)
kruskal.test(time, group)
##
## Kruskal-Wallis rank sum test
##
## data: time and group
## Kruskal-Wallis chi-squared = 11.914, df = 3, p-value = 0.007683
Since the p-value \(= 0.0077\) for the Kruskal-Wallis test, we reject \(H_0\) at the \(5\%\) significance level. We conclude that there is sufficient evidence to show that the time to failure are not the same for all the four groups of batteries.