Reputation: 2050
I have some pilot data that I should be able to exploit to adjust the prior in a Bayes t-test on a newer dataset.
I've been performing Bayes t-tests using the default settings via the package BayesFactor in R. Can anyone shed some light on how exactly I can go about adjusting the prior for such a test?
Additionally, what do I need from the pilot data to make this happen? I suspect an effect size?
Here's an example of how to employ the Bayes t-test using the default settings:
ttestBF(x = df1$Value, df2$Value, paired = TRUE)
Thanks for your time.
Upvotes: 1
Views: 964
Reputation: 151
For reference see Rouder et al. 2009. The BayesFactor package in R uses a JZS prior. See the explanation in the documentation of the ttestBF function:
A noninformative Jeffreys prior is placed on the variance of the normal population, while a Cauchy prior is placed on the standardized effect size. The rscale argument controls the scale of the prior distribution, with rscale=1 yielding a standard Cauchy prior. See the references below for more details.
For the rscale argument, several named values are recognized: "medium", "wide", and "ultrawide". These correspond to r scale values of sqrt(2)/2, 1, and sqrt(2) respectively.
Then in the paper it is said:
For both JZS and scaled-information priors, as r is increased, the Bayes factor provides increased support for the null.
Which basically means, that if you expect really small effect sizes, you should lower the r parameter.
About your second question:
You should be able to use your piloting data as an estimate for the expected effect size and adjust the priors accordingly.
Be aware that you should not adjust your prior with regard to the observed data (i.e. the new data).
Furthermore, with regards to the BayesFactor package I would assume that the default priors should work pretty well with most data (at least if it's from psychology). See the other references provided in the help function.
I hope this helps a little :) , unfortunately, I cannot tell you whether or how to calculate the best scale for your effect size, as there is also a trade off between effect size and BF for really large sample sizes.
Upvotes: 2