在 R 中的 BayesFactor 包中调整先验

Adjusting priors in the package BayesFactor in R

我有一些试验数据,我应该能够利用这些数据在较新的数据集上调整贝叶斯 t 检验中的先验。

我一直在通过 R 中的 BayesFactor 包使用默认设置执行贝叶斯 t 检验。任何人都可以阐明我如何为这样的测试调整先验吗?

此外,我需要从试点数据中获得什么才能实现这一目标?我怀疑效果大小?

以下是如何使用默认设置使用贝叶斯 t 检验的示例:

ttestBF(x = df1$Value, df2$Value, paired = TRUE)

谢谢你的时间。

参考 Rouder et al. 2009。 R 中的 BayesFactor 包使用 JZS 先验。参见ttestBF函数文档中的解释:

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.

然后在论文中说:

For both JZS and scaled-information priors, as r is increased, the Bayes factor provides increased support for the null.

这基本上意味着,如果您期望效果量非常小,则应降低 r 参数。

关于你的第二个问题: 您应该能够使用您的试点数据作为预期效果大小的估计,并相应地调整先验。 请注意,您不应根据观察到的数据(即新数据)调整先验。
此外,关于 BayesFactor 包,我假设默认先验应该适用于大多数数据(至少如果它来自心理学)。请参阅帮助功能中提供的其他参考资料。

我希望这能有所帮助 :) 不幸的是,我无法告诉您是否或如何计算您的效果大小的最佳比例,因为对于非常大的样本大小,效果大小和 BF 之间也存在权衡.