I would like to make sure that I'm using friedman.test() correctly, because I have to reformat my data set to fulfil the requirement "exactly one observation in y for each combination of levels of groups and blocks" mentioned in the help page of function friedman.test().
Assuming data from http://www.inside-r.org/packages/cran/muStat/docs/mu.kruskal.test treatments <- factor(rep(c("Trt1", "Trt2", "Trt3"), each=4)) people <- factor(rep(c("Subj1", "Subj2", "Subj3", "Subj4"), 3)) y <- c(0.73,0.76,0.46,0.85,0.48,0.78,0.87,0.22,0.51,0.03,0.39,0.44) midata <- data.frame(treatments,people,y) midata[1:10,] I would do as follows: Test among treatments friedman.test(y ~ treatments|people,data=midata) Test among subjects friedman.test(y ~ people|treatments,data=midata) Is this correct? Thanks -- Agustin Lobo aloboa...@gmail.com ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.