BPvalue {glmmAK}R Documentation

Univariate Bayesian P-value (pseudo-contour probability)

Description

For a sample (from the posterior distribution) of theta this function computes

P=2*min(P(theta<0, theta>0)),

which can be viewed as a counterpart of a classical two-sided P-value.

Note that this is the same as a univariate pseudo-contour probability as described in Besag et al. (1995, p. 30) and in Held (2004).

Usage

BPvalue(sample)

Arguments

sample vector, matrix or data frame with sampled values. If it is a matrix or data frame then it is assumed that each column corresponds to a separate parameter and the P-value is computed separately for each column.

Value

Vector of computed P-values.

Author(s)

Arnošt Komárek arnost.komarek[AT]mff.cuni.cz

References

Besag, J., Green, P., Higdon, D. and Mengersen, K. (1995). Bayesian computation and stochastic systems (with Discussion). Statistical Science, 10, 3 - 66.

Held, L. (2004). Simultaneous posterior probability statements from Monte Carlo output. Journal of Computational and Graphical Statistics, 13, 20 - 35.

Examples

m <- 1000
sample <- rnorm(m, mean=1)
BPvalue(sample)
## compare with
2*pnorm(0, mean=1, lower.tail=TRUE)

sample <- data.frame(x1=rnorm(m), x2=rnorm(m, mean=-1), x3=rnorm(m, mean=2))
BPvalue(sample)
## compare with
2*pnorm(0, mean=0)
2*pnorm(0, mean=-1, lower.tail=FALSE)
2*pnorm(0, mean=2, lower.tail=TRUE)

[Package glmmAK version 1.2 Index]