Bft2x2 function

Bayesian analysis of a 2 x 2 contingency table.

Bayesian analysis of a 2 x 2 contingency table.

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).

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.

Returns

the matrix of div x div posterior probabilities that was plotted

References

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

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

Author(s)

Robert van Hulst

See Also

fisher.test

Examples

data(Glasses) Bft2x2(Glasses)
  • Maintainer: Robert van Hulst
  • License: GPL (>= 2)
  • Last published: 2018-05-15

Useful links