#############kruskal walis test########
Input =("
Group Value
Group.1 19
Group.1 11.7
Group.1 17.8
Group.1 14.8
Group.1 13.9
Group.2 18.2
Group.2 14.8
Group.2 13.1
Group.2 12.6
Group.2 15.2
Group.2 12.8
Group.3 13.4
Group.3 14.1
Group.3 12.3
Group.3 12.3
Group.3 14.7
Group.3 13.9
Group.3 13.8
Group.3 14.3
")

Data = read.table(textConnection(Input),header=TRUE) library(dplyr)
Data =mutate(Data,Group = factor(Group, levels=unique(Group)))

library(lattice)
histogram(~Value|Group,data=Data,layout=c(1,3))


library(FSA)
Summarize(Value ~ Group,data = Data)
kruskal.test(Value ~ Group,data = Data)

##########Friedman test ###############

x1<-c(3,4,3)
x2<-c(4,3,4)
x3<-c(2,2,1)
x4<-c(1,1,2)
x<-cbind(x1,x2,x3,x4)
friedman.test(x)



##########kolmogrov smirnov test 1 sample###############
x<-c(0.621,0.503,0.203,0.477,0.710,0.581,0.329,0.480,0.554,0.382)
plot(ecdf(x))
ks.test(x, "punif")
ks.test(x, "pnorm")


##########kolmogrov smirnov test 2 sample###############
x<-c(10.3,11.2,11.5,11.9,12.8)
y<-c(10.4,11.8,12.5,12.6,13.8,13.9)
ks.test(x, y, alternative = "two.sided")
plot(ecdf(x))
plot(ecdf(y))
        

