Bft2x2 {evidence} | R Documentation |
Bayesian analysis of a 2 x 2 contingency table.
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
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
Examples
data(Glasses)
Bft2x2(Glasses)