richarddmorey
About
 Username
 richarddmorey
 Joined
 Visits
 26
 Last Active
 Roles
 Member, Moderator
Comments

Hi Julia, This is an issue with the {Matrix} package and {MatrixModels} package. You can solve it by following the advice here: https://stackoverflow.com/questions/77530214/errordsparsemodelmatrixobjectsuperclassxmatrixnotdefined/77530730#7753…

Yes, Sherloconan, that's correct. You can get the design matrix from a Bayes factor test that will tell you more with the model.matrix, , e.g.: library(BayesFactor) bf = BayesFactor::anovaBF(y ~ Factor1*Factor2, data = my_df) model.matrix(bf['Factor…

The priors for continuous covariates are different in more than just the scaling: when you enter variable as a continuous covariates, the prior depends on the covariance matrix. When the variables are truly categorical, the covariance matrix is esse…

This is a question for EJ, since BFexcl is his thing. Conceptually, yes, since BFexcl is a function of the individual BFs, but it might be a bit difficult/time consuming to calculate.

Hi Nico, I took a look at that paper and noticed that it ignores the error estimate on the BF, which is relevant here. I can't be sure without reproducing their figures, but I suspect the rare outliers in their simulations would be accompanied by la…

Not by default, but it is easy in R. Here's some example code, using sapply. # Data for the example: set.seed(111) x = rnorm(20) y = rnorm(20) + .7 library(BayesFactor) ## With default default_bf = as.vector(ttestBF(x,y)) ## equal intervals on …

There's no default way of doing it in the BayesFactor package, but it is trivial to program up in R. Here's a function. You can do a bounded Cauchy using ttestBF and the nullInterval argument, or you can use the function below to use a bounded unifo…

Looks like you just need to sample from the posterior: (BF_test < anovaBF(DV ~ Level + Subject, data = dat, whichRandom = "Subject", progress = FALSE)) BF_samples = posterior(BF_test, iterations=10000) HPDinterval(…

Hi Dorothy, All the code can be found on the github page. `ttestBF()` can be found here: https://github.com/richarddmorey/BayesFactor/blob/master/pkg/BayesFactor/R/ttestBF.R `ttest.tstat()` can be found here: https://github.com/richarddmorey/BayesF…

Those are log Bayes factors (see https://www.rdocumentation.org/packages/BayesFactor/versions/0.9.124.2/topics/oneWayAOV.Fstat).

It can actually be used for any F statistic that has the desired prior distribution over the effect size (see https://www.sciencedirect.com/science/article/abs/pii/S0022249611000666 for details of the model). It won't give you precisely the same ans…

The basic steps are: * Make a scatterplot * Fit the model * Extract the model parameters from the object (whatever it is) * Use abline() to plot the lines You can do this with either lm() estimates or BayesFactor::posterior() estimates (or whateve…

They use the same functions on the backend to compute the BF, so this is likely an issue with factor definitions in R or the like. Could you create a reproducible example?

Hi Aram, Could you post a reproducible example showing the error? Thanks.

SPSS is in error, almost surely. It would require a prior scale of almost two to get that low a Bayes factor. Here's my check. This isn't exactly right, because it appears you have slightly different numbers in each group, but this is the only way …

So I've tried reproducing this with simulated data, and I can't get it to work. See the following (change the seed for different data): library(BayesFactor)library(ggplot2)set.seed(8)N = 20effect = .2sigma.sub = 1sigma.err = .2y.mat = outer(rnorm(N…

I'm wondering if there are interactions with participant here: that is, there are effects that are not picked up in your model (variance between subjects in how big the effect is) that are not modelled, and so they are being picked up as noise. Ther…

I wouldn't bother reporting the error, provided you get it sufficiently low that it seems trustworthy. Try plot(bf) and look at the red error bars to see if you have reason for concern.

Hi Aram, I'm not sure how to reproduce what you did because you did not provide code, but when I load the data and run: bf = anovaBF(rt ~ a + d + a:d + p + a:p + d:p + a:d:p + s, data = dat, whichRandom = "s")sort(bf, decreasing = TRUE) …

Hi Eduard, * Simply use the function "as.vector" to extract the Bayes factors from a Bayes factor object. * The only differences between the whichModels specifications are which models are tested, and to which models they are compared: …

You can create the contrasts you want and define them as predictors, then use lmBF to test them.

"I predict that reaction times will not increase as the object size increases (a linear trend)" Is the alternative really a linear increase? The first part of your hypothesis suggests an unstructured alternative (and do you mean average R…

This is not currently supported in the formula itself, but you can create the relevant contrasts as columns in your data frame and then include those in the formula.

The Bayesian "repeated measures ANOVA" in JASP is not really a "repeated measures ANOVA"; it is only called that so that people won't get confused. In the background it is using the BayesFactor package, which implements Bayesian …

What is it that JASP is not letting you do? BayesFactor should allow you to do it, I think, if you don't mind using R.

Hi Frederik, how strongly related are the materials? If you found that an order held for one material, would this lead you to strongly suspect the same ordering for another?