Bft2x2: Bayesian analysis of a 2 x 2 contingency table.

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/Bft2x2.R

Description

A 2 x 2 contingency table (in matrix form) is analyzed in a Bayesian way using uniform priors. The posterior probabilities of each of the the two outcomes given the other factor levels are calculated. See MacKay(2003, p. 460).

Usage

1
Bft2x2(X, div = 100, plotit = TRUE)

Arguments

X

a contingency table in the form of a 2 x 2 matrix with row and column names

div

optional: the number of divisions for the row and column variables for use in calculations (can be left at 100)

plotit

should plots be produced? (defaults to TRUE)

Details

Note that the rows of the 2 x 2 matrix are assumed to represent the "outcomes" and the columns the "treatments"—where these expressions are applicable. Note also that to obtain properly labeled plots the matrix has to be supplied with dimnames.

Value

the matrix of div x div posterior probabilities that was plotted

Author(s)

Robert van Hulst

References

MacKay, D.J.C. 2003. Information Theory, Inference, and Learning Algorithms. Cambridge University Press, Cambridge.

van Hulst, R. 2018. Evaluating Scientific Evidence. ms.

See Also

fisher.test

Examples

1
2

evidence documentation built on May 2, 2019, 2:14 p.m.