fisher.multcomp function

Pairwise comparisons using Fisher's exact test

Pairwise comparisons using Fisher's exact test

Performs pairwise comparisons after a comparison of proportions or after a test for independence of 2 categorical variables, by using a Fisher's exact test.

fisher.multcomp(tab.cont, p.method = "fdr")

Arguments

  • tab.cont: contingency table.
  • p.method: method for p-values correction. See help of p.adjust.

Details

Since chi-squared and G tests are approximate tests, exact tests are preferable when the number of individuals is small (200 is a reasonable minimum).

Returns

  • method: name of the test.

  • data.name: a character string giving the name(s) of the data.

  • p.adjust.method: method for p-values correction.

  • p.value: table of results of pairwise comparisons.

Author(s)

Maxime HERVE maxime.herve@univ-rennes1.fr

See Also

chisq.test, prop.test, fisher.test

Examples

# 2-column contingency table: comparison of proportions tab.cont1 <- matrix(c(17,23,12,24,20,10),ncol=2,dimnames=list(c("Control", "Treatment1","Treatment2"),c("Alive","Dead")),byrow=TRUE) fisher.test(tab.cont1) fisher.multcomp(tab.cont1) # 3-column contingency table: independence test tab.cont2 <- as.table(matrix(c(25,10,12,6,15,14,9,16,9),ncol=3,dimnames=list(c("fair", "dark","russet"),c("blue","brown","green")))) fisher.test(tab.cont2) fisher.multcomp(tab.cont2)
  • Maintainer: Maxime HERVE
  • License: GPL-2
  • Last published: 2023-11-06

Useful links