# R notes # ================================= # index to these notes # Wilcoxon signed rank test # ================================= # Rosner, chapter 9 # R Tutor : sign test # http://www.r-tutor.com/elementary-statistics/non-parametric-methods/sign-test # R : sign test { BSDA } # http://rss.acs.unt.edu/Rdoc/library/BSDA/html/sign.test.html # R Tutorial : Wilcoxon signed rank test # http://www.r-tutor.com/elementary-statistics/non-parametric-methods/wilcoxon-signed-rank-test # R Tutorial : Mann-Whitney-Wilcoxon test # http://www.r-tutor.com/elementary-statistics/non-parametric-methods/mann-whitney-wilcoxon-test # R Tutorial : Kruskal-Wallis test # http://www.r-tutor.com/elementary-statistics/non-parametric-methods/kruskal-wallis-test # R : wilcox.test() ?wilcox.test() # Wilcoxon signed rank test : the data # R Tutorial : Wilcoxon signed rank test # http://www.r-tutor.com/elementary-statistics/non-parametric-methods/wilcoxon-signed-rank-test di.neg <- -(1:10) fi.neg <- c(4,4,5,1,2,2,3,1,0,0) di.pos <- 1:10 fi.pos <- c(10,6,2,0,0,0,0,0,0,0) di.0 <- c(0) fi.0 <- c(5) differences.neg <- cbind(c(di.0, di.neg), c(fi.0, fi.neg)); differences.neg # A better barplot(c(fi.0, fi.neg), col="wheat3", names.arg=-(0:10), xlab="difference in redness", ylab="frequency",main="Negative differences (A better)") barplot(fi.pos, col="wheat3", names.arg=1:10, xlab="difference in redness", ylab="frequency",main="Positive differences (B better)") # =================================