Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

BFBayesFactorList-class

General S4 class for representing a collection of Bayes factor model comprisons, each against a different denominator


Description

The BFBayesFactorList class is a general S4 class for representing models model comparison via Bayes factor. See the examples for demonstrations of BFBayesFactorList methods.

Usage

## S4 method for signature 'BFBayesFactorList'
t(x)

## S4 method for signature 'numeric,BFBayesFactorList'
e1 / e2

## S4 method for signature 'BFBayesFactorList,index,index,missing'
x[i, j, ..., drop = TRUE]

## S4 method for signature 'BFBayesFactorList,index,missing,missing'
x[i, j, ...,
  drop = TRUE]

## S4 method for signature 'BFBayesFactorList,missing,index,missing'
x[i, j, ...,
  drop = TRUE]

Arguments

x

a BFBayesFactorList object

e1

Numerator of the ratio

e2

Denominator of the ratio

i

indices specifying rows to extract

j

indices specifying columns to extract

...

further arguments passed to related methods

drop

unused

Details

BFBayesFactorList objects inherit from lists, and contain a single slot:

version

character string giving the version and revision number of the package that the model was created in

Each element of the list contains a single "BFBayesFactor" object. Each element of the list must have the same numerators, in the same order, as all the others. The list object is displayed as a matrix of Bayes factors.

Examples

## Compute some Bayes factors to demonstrate Bayes factor lists
data(puzzles)
bfs <- anovaBF(RT ~ shape*color + ID, data = puzzles, whichRandom = "ID", progress=FALSE)

## Create a matrix of Bayes factors
bfList <- bfs / bfs
bfList

## Use indexing to select parts of the 'matrix'
bfList[1,]
bfList[,1]

## We can use the t (transpose) function as well, to get back a BFBayesFactor
t(bfList[2,])

## Or transpose the whole matrix
t(bfList)

BayesFactor

Computation of Bayes Factors for Common Designs

v0.9.12-4.2
GPL-2
Authors
Richard D. Morey [aut, cre, cph], Jeffrey N. Rouder [aut], Tahira Jamil [ctb, cph], Simon Urbanek [ctb, cph], Karl Forner [ctb, cph], Alexander Ly [ctb, cph]
Initial release
2018-05-09

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.