Friedman Test with R
Data Description:
The Friedman test is performed in R using the command "friedman.test" in the base package "stats". Note its input needs to be a vector or a matrix.
>cycl<-read.table(file="http://ramanujan.math.trinity.edu/ekwessi/misc/cyclamate.txt", header=T) # Loading the data into the R-workspace
>head(cyclamate)
Sample PicrylChloride Davies AOAC
>is.matrix(cycl) #Testing if the dataset cycl in the R-workspace is a matrix
[1] FALSE
>cylc1<-as.matrix(cycl[c(-1)]) # Dropping the variable "Sample" and transforming the remaining dataset as a matrix
>head(cycl1) # Visualizing the first 6 observations of the new dataset
PicrylChloride Davies AOAC
> friedman.test(cycl1) # Perfoming the Friedman test
data: cycl1
Interpretation of the result:
The p-value (0.0001376) for this test is very small. It is therefore plausible that the three methods have statistically significant different medians, t