Last data update: 2014.03.03

R: Logarithm of integral of Bayes factor for testing homogeneity...
bfexchR Documentation

Logarithm of integral of Bayes factor for testing homogeneity of proportions

Description

Computes the logarithm of the integral of the Bayes factor for testing homogeneity of a set of proportions

Usage

bfexch(theta,datapar)

Arguments

theta

value of the logit of the prior mean hyperparameter

datapar

list with components data, matrix with columns y (counts) and n (sample sizes), and K, prior precision hyperparameter

Value

value of the logarithm of the integral

Author(s)

Jim Albert

Examples

y=c(1,3,2,4,6,4,3)
n=c(10,10,10,10,10,10,10)
data=cbind(y,n)
K=20
datapar=list(data=data,K=K)
theta=1
bfexch(theta,datapar)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(LearnBayes)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/LearnBayes/bfexch.Rd_%03d_medium.png", width=480, height=480)
> ### Name: bfexch
> ### Title: Logarithm of integral of Bayes factor for testing homogeneity of
> ###   proportions
> ### Aliases: bfexch
> ### Keywords: models
> 
> ### ** Examples
> 
> y=c(1,3,2,4,6,4,3)
> n=c(10,10,10,10,10,10,10)
> data=cbind(y,n)
> K=20
> datapar=list(data=data,K=K)
> theta=1
> bfexch(theta,datapar)
[1] -16.48318
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>