BayesFactor程序包R:两种不同的输出 [英] BayesFactor Package R: Two different Output

查看:247
本文介绍了BayesFactor程序包R:两种不同的输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用BayesFactor程序包,但使用两个非常相似的代码,对于相同数据,我会得到两个不同的输出.我想知道哪一个是正确的?

I'm using the BayesFactor package but I get two different output for the same data using two very similar codes. I'm wondering which one is correct?

if(!require(BayesFactor)){install.packages('BayesFactor')}

require(BayesFactor)
##################################################

exp(ttest.tstat(t= 2 , n1=40, n2=40, nullInterval =c(0, Inf), rscale = sqrt(2)/2,
        complement = FALSE, simple = FALSE)$bf)   ### !CHECK THIS OUTPUT! ###


exp(ttest.tstat(t= 2 , n1=40, n2=40, nullInterval =c(0, Inf), rscale = sqrt(2)/2, 
       complement = FALSE, simple = TRUE))    ### !CHECK THIS OUTPUT! ###

推荐答案

?ttest.tstat

如果simple为TRUE,则返回Bayes因子(与null相对).如果 FALSE,该函数返回一个长度为3的向量,其中包含 计算的 log(e)贝叶斯因子以及比例误差估计 贝叶斯因子及其计算方法.

If simple is TRUE, returns the Bayes factor (against the null). If FALSE, the function returns a vector of length 3 containing the computed log(e) Bayes factor, along with a proportional error estimate on the Bayes factor and the method used to compute it.

本质上,当simple=TRUE

ttest.tstat(t= 2 , n1=40, n2=40, nullInterval =c(0, Inf),
   rscale = sqrt(2)/2, complement = FALSE, simple = TRUE)
#     B10 
# 2.502954 

simple=FALSE

exp(ttest.tstat(t= 2 , n1=40, n2=40, nullInterval =c(0, Inf),
        rscale = sqrt(2)/2, complement = FALSE, simple = FALSE)$bf)
#[1] 2.502954

这篇关于BayesFactor程序包R:两种不同的输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆