richarddmorey / BayesFactor

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

Problems with the examples in the manual #104

Closed chiovetto closed 6 years ago

chiovetto commented 7 years ago

I have problem running BayesFactor on my computer. I have R v. 3.3.0 installed. Running this code from your tutorial

library(readr); library(ggplot2); library(BayesFactor); library(arm); rm( list = ls ()) data(ToothGrowth)

Example plot from ?ToothGrowth

coplot(len ~ dose | supp, data = ToothGrowth, panel = panel.smooth, xlab = "ToothGrowth data: length vs dose, given type of supplement")

Treat dose as a factor

ToothGrowth$dose = factor(ToothGrowth$dose) levels(ToothGrowth$dose) = c("Low", "Medium", "High")

summary(aov(len ~ suppdose, data=ToothGrowth)) bf = anovaBF(len ~ suppdose, data=ToothGrowth) bf

I get the following error

Error in validObject(.Object) : invalid class “ddenseModelMatrix” object: superclass "replValueSp" not defined in the environment of the object's class

and the following incomplete output:

Bayes factor analysis

[1] supp : 1.198757 ±0.01% [2] dose : 4.983636e+12 ±0% [3] supp + dose : NA ±NA% [4] supp + dose + supp:dose : NA ±NA%

Against denominator: Intercept only

Bayes factor type: BFlinearModel, JZS

I u updated the Matrix package but I still get the error. How can i fix this problem? Thanks EC

richarddmorey commented 7 years ago

Have you tried updating R?