richarddmorey / BayesFactor

BayesFactor R package for Bayesian data analysis with common statistical models.
https://richarddmorey.github.io/BayesFactor/
132 stars 49 forks source link

neverExclude sometimes allows no tests (causing an error) #13

Closed richarddmorey closed 10 years ago

richarddmorey commented 10 years ago

The following code

data(puzzles)
generalTestBF(RT ~ color * shape+ID:shape+ID:color+ID+ID:shape:color, data = puzzles, whichRandom = "ID", whichModels = "all", neverExclude = "ID",noSample=TRUE)

returns the error

Error in combn(x, m, simplify = FALSE) : n < m

because the argument neverExclude here requires that any term with ID remain included. This keeps the three-way interaction in the model, so no lower-order terms can be removed. However, whichModels="all" should allow the removal of the lower-order terms not including ID.

The error occurs because nothing can be removed, so the remaining set of terms is empty (and thus no combinations can be made).