richarddmorey / BayesFactor

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

Error with generalTestBF() random factors #44

Closed jonathon-love closed 9 years ago

jonathon-love commented 9 years ago

executing the following code:

load("bugs.RData")
formula <- as.formula("rating ~ frightening + gender + education + frightening:gender + frightening:education + gender:education + frightening:gender:education")
generalTestBF(formula, data=bruce, whichModels="withmain", whichRandom=c("gender", "education"))

gives the following error:

Error in nWayAOV(y, X, gMap = gMap, rscale = rscale, gibbs = gibbs, continuous = continuous,  : 
  Invalid gMap argument. length(gMap) must be the the same as the number of parameters (excluding intercept): 35 != 21
In addition: Warning message:
In nWayAOV(y, X, gMap = gMap, rscale = rscale, gibbs = gibbs, continuous = continuous,  :
  2 constant columns removed from X.

i'll email bugs.RData

this interests @mmarsman1

richarddmorey commented 9 years ago

This appears to be due to the fact that there missing interaction levels:

> table(bruce$gender,bruce$education)

       --- advance college high less partial some
Female   4      11      12   46   63       4  155
Male     0       0       8   32   36       4   64

and hence it cannot estimate those parameters. It is (properly) removing them from the design, in some places but not others. I will fix this.

jonathon-love commented 9 years ago

Do you have an ETA for BayesFactor 0.100 ? We'd like to incorporate this fix for JASP 0.5, and we'd prefer to use official releases rather than intermediate versions, but we can use an intermediate if you're not planning a 0.100 for a while.

richarddmorey commented 9 years ago

I did not have an ETA. What's your ETA for JASP 0.5?

jonathon-love commented 9 years ago

maybe early next week. it's not a problem using an intermediate version.