BF2pp: Transform Bayes factors to posterior probabilities

Description Usage Arguments Value Examples

View source: R/BF2pp.R

Description

Transforms the Bayes factor for a hypothesis H_1 against a hypothesis H_2 to the posterior probability of H_1 given the prior probability of H_1 (assuming that the prior probabilities of H_1 and H_2 add up to 1).

Usage

1
BF2pp(BF, prior.prob=0.5)

Arguments

BF

a vector of Bayes factors

prior.prob

a vector of prior probabilities for H_1. Defaults to a vector with entries 0.5.

Value

A numeric vector of posterior probabilities of the hypothesis H_1

Examples

1
BF2pp(BF=c(2, 10, 50), prior.prob=c(0.2, 0.5, 0.9))

Example output

Loading required package: exact2x2
Loading required package: exactci
Loading required package: ssanv
Loading required package: MCMCpack
Loading required package: coda
Loading required package: MASS
##
## Markov Chain Monte Carlo Package (MCMCpack)
## Copyright (C) 2003-2020 Andrew D. Martin, Kevin M. Quinn, and Jong Hee Park
##
## Support provided by the U.S. National Science Foundation
## (Grants SES-0350646 and SES-0350613)
##
[1] 0.3333333 0.9090909 0.9977827

pCalibrate documentation built on March 20, 2020, 1:09 a.m.