Skip to content

Instantly share code, notes, and snippets.

View sithjaisong's full-sized avatar

Sith Jaisong sithjaisong

View GitHub Profile
@sithjaisong
sithjaisong / friedman.test.with.post.hoc.R
Last active July 21, 2017 05:05
friedman.test.with.post.hoc.R
# ref:https://www.r-statistics.com/tag/friedman-test/
friedman.test.with.post.hoc <- function(formu, data, to.print.friedman = T, to.post.hoc.if.signif = T, to.plot.parallel = T, to.plot.boxplot = T, signif.P = .05, color.blocks.in.cor.plot = T, jitter.Y.in.cor.plot =F)
{
# formu is a formula of the shape: Y ~ X | block
# data is a long data.frame with three columns: [[ Y (numeric), X (factor), block (factor) ]]
# Note: This function doesn't handle NA's! In case of NA in Y in one of the blocks, then that entire block should be removed.
# Loading needed packages