Learn R Programming

rmngb (version 0.6-1)

pairwise count tests: Pairwise Chi-squared and Fisher Test

Description

Calculate pairwise comparisons between group levels with corrections for multiple testing.

Usage

pairwise.chisq.test(x, ...) pairwise.fisher.test(x, ...)
"pairwise.chisq.test"(x, g, p.adj = p.adjust.methods, ...) "pairwise.chisq.test"(x, p.adj = p.adjust.methods, DNAME = NULL, ...)
"pairwise.fisher.test"(x, g, p.adj = p.adjust.methods, ...) "pairwise.fisher.test"(x, p.adj = p.adjust.methods, DNAME = NULL, ...)

Arguments

x
a numeric vector or matrix. x and g can also both be factors.
g
a vector; ignored if x is a matrix.
p.adj
correction method among holm, hochberg, hommel, bonferroni, BH, BY, fdr and none.
DNAME
table dimension names.
...
further arguments to be passed to or from methods.

Value

Object of class "pairwise.htest".

Details

Calculate Chi-square or Fisher test p-values for all combinaisons of the levels of g.

References

Original functions written by Dr Jean-Philippe Jais.

See Also

pairwise.t.test, p.adjust.

Examples

Run this code
x <- sample(1:2, 1e3, TRUE)
g <- sample(1:4, 1e3, TRUE)
pairwise.chisq.test(x, g)
tab <- table(g, x)
pairwise.fisher.test(tab, p.adj = "bonf")

Run the code above in your browser using DataLab