fisher {broman}R Documentation

Fisher's exact test for a two-way table

Description

Performs a sampling version of Fisher's exact test for a two-way contingency table.

Usage

fisher(tab, n.sim = 1000)

Arguments

tab

A matrix of counts.

n.sim

Number of samples of permuted tables to consider.

Details

This is like the function stats::fisher.test(), but calculates an approximate P-value rather than performing a complete enumeration. This will be better for large, sparse tables.

Value

A single number: the P-value testing independence of rows and columns in the table.

See Also

stats::chisq.test(), stats::fisher.test(), chisq()

Examples

TeaTasting <- matrix(c(3,1,1,3),nrow=2)
fisher(TeaTasting,1000)


[Package broman version 0.80 Index]