Learn R Programming

RVAideMemoire (version 0.9-7)

fisher.multcomp: Pairwise comparisons after a test for independence of 2 categorical variables

Description

Perform pairwise comparisons after a test for independence of 2 categorical variables, using a Fisher's exact test on each possible 2x2 table. For readability, the function returns results of comparison having a p-value < 0.1.

Usage

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

Arguments

tab.cont
contingency table.
p.method
method for p-values correction. See help of the p.adjust() function.

Value

  • p.methodmethod for p-values correction.
  • levelslevels of each factor used for creating each 2x2 table.
  • odds.ratiostatistics of each test.
  • p.valuecorrected p-values.
  • total.recapdata frame of all comparisons.
  • limited.recapdata frame of restricted comparisons (p<0.1).< description="">

See Also

chisq.test, fisher.test

Examples

Run this code
tab.cont<-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"))))
chisq.test(tab.cont)
fisher.multcomp(tab.cont)

Run the code above in your browser using DataLab