How to get a BEST prior from a known effect size

As I had massive problems finding a clear instruction on how to turn a known effect size into a prior for a BEST (Kruschke 2013) analysis, I decided to write a short tutorial on how I managed it myself.

In my specific example, I did not know where the mean of either of my groups would lie, but I knew what difference I had to expect due to a prior study reporting an effect size of Cohen’s d=0.2. I had an n=60 (30 per group). Following Kruschke (2013) I chose an uninformed prior for my reference group:
prior_GroupNormal <- mean(GroupNormal)

For my “intervention” group I now transformed the formula for Cohen’s d:
\[ d={ {(\mu_1 - \mu_2)}\over {s} } |*s \\ d*s = \mu_1 - \mu_2 |+\mu_2 \\ \mu_2+d*s = \mu_1 \\ \mu_1 = \mu_2 + d* \sqrt{{(n_1 - 1)s_{1}^2 + (n_2-1)s_{2}^2}\over{n_1 + n_2 - 2}} \\ \]

It is obvious when you look at the done formula, but since I had overlooked this during working on it: μ1 is the experimental not the control group!

Now the formula can be filled with what we know:
Our n=30 for both groups. Our s1 and s2 are sd(groupNormal) and sd(group2) respectively and μ2 is mean(group2).
Our d=0.2.

In code this looks something like this:

library(BEST)
groupNormal <- rnorm(30, mean=20, sd=5)
groupExp <- rnorm(30, mean=23, sd=5)
prior_groupNormal <- mean(groupNormal)
prior_groupExp <- mean(groupNormal + 0.2*sqrt(((30 - 1)*sd(groupNormal)^2+(30 - 1)*sd(groupExp)^2)/(30 + 30 - 2)))
priorList <- list(muM=c(prior_groupNormal, prior_groupExp))
BEST_group <- BESTmcmc(groupNormal,groupExp, prior=priorList)
plotAll(BEST_group)

If the work you want to base your prior one doesn’t provide d as their effect size I can recommend this page if you speak German https://www.psychometrica.de/effektstaerke.html#transform (the linked widget is probably also understandable without knowledge of German).

I hope you found this little guide helpful. Like I said in the beginning, this is pretty obvious once you’ve seen it, still it is pretty hard to figure out when you have never done it before. Also please feel totally free to point out any mistake in this approach!

#References

Kruschke, John K. 2013. “Bayesian estimation supersedes the T test.” Journal of Experimental Psychology: General 142 (2): 573–88. https://doi.org/10.1037/a0029177.

Jan B. Vornhagen
Jan B. Vornhagen
PhD Fellow Digital Design
comments powered by Disqus