测试正交与贝叶斯的单程ANOVA R形成鲜明对比

发布于 2025-01-27 04:38:09 字数 1130 浏览 2 评论 0原文

我正在测试两种治疗对血糖水平的影响。 我的数据的结构类似于以下内容:

ID <- c('1','2','3','4','5','6')
GROUP <- c('0','1','0','2','1','2')
DIFF_GLYCEMIA <- c('12','14','11','7.5','12','8')
DF <- data.frame(ID, GROUP, DIFF_GLYCEMIA)
DF$GROUP <- as.factor(DF$GROUP)
DF$DIFF_GLYCEMIA <- as.numeric(DF$DIFF_GLYCEMIA)

我想测试组的线性影响的特定预测:这意味着在第0组(对照)中对血糖的影响要比在第1组(药物)(药物)中较小影响将小于在第2组中的影响(药物 +心理干预)。通常,我会形成正交的对比,如下所示,如果C1很重要,但C2不明显,则证实了我的假设。

c1 <- c(-1 , 0, 1)
c2 <- c( 1,  -2, 1 )
contrasts(DF$GROUP) = cbind(c1, c2)
model <- aov(DIFF_GLYCEMIA ~ GROUP, data = DF)
summary.aov(model, split=list(GROUP=list("c1"=1, "c2" = 2))) 

但是这次,我需要做一个贝叶斯方差分析,我不知道该怎么做。所有解决方案似乎都整合了对比度,而是给我一个输出(解决方案1),或者比较模型(解决方案2),该模型似乎回答了一个不同的问题。

# solution 1

contrasts(DF$GROUP) = cbind(c1, c2)
anovaBF(DIFF_GLYCEMIA ~ GROUP, data = DF)
# output : GROUP : X.XXXX ±0.0X%


# solution 2

generalTestBF(DIFF_GLYCEMIA~c1+c2, data=DF, whichModels="all")
# output : c1 : X.XXXX ±0.0X%
#          c2 : X.XXXX ±0.0X%
#      c1 + c2: X.XXXX ±0.0X%

有人知道如何进行相同的ANOVA分析,但是贝叶斯人? 非常感谢您!

I am testing the impact of two treatments on blood sugar level.
The structure of my data is similar to the following:

ID <- c('1','2','3','4','5','6')
GROUP <- c('0','1','0','2','1','2')
DIFF_GLYCEMIA <- c('12','14','11','7.5','12','8')
DF <- data.frame(ID, GROUP, DIFF_GLYCEMIA)
DF$GROUP <- as.factor(DF$GROUP)
DF$DIFF_GLYCEMIA <- as.numeric(DF$DIFF_GLYCEMIA)

I want to test the specific prediction of a linear impact of group: meaning that being in group 0 (control) will have a smaller impact on glycemia than being in group 1 (drugs) which impact will be smaller than the impact of being in group 2 (drugs + psychological intervention). Usually, I create orthogonal contrasts as follow and if c1 is significant but not c2, it confirms my hypothesis.

c1 <- c(-1 , 0, 1)
c2 <- c( 1,  -2, 1 )
contrasts(DF$GROUP) = cbind(c1, c2)
model <- aov(DIFF_GLYCEMIA ~ GROUP, data = DF)
summary.aov(model, split=list(GROUP=list("c1"=1, "c2" = 2))) 

But this time, I need to do a bayesian anova and I don't know how to do that. All the solution seems to integrate the contrast but rather give me one output (solution 1), or compare the model (solution 2) which seems to answer a different question.

# solution 1

contrasts(DF$GROUP) = cbind(c1, c2)
anovaBF(DIFF_GLYCEMIA ~ GROUP, data = DF)
# output : GROUP : X.XXXX ±0.0X%


# solution 2

generalTestBF(DIFF_GLYCEMIA~c1+c2, data=DF, whichModels="all")
# output : c1 : X.XXXX ±0.0X%
#          c2 : X.XXXX ±0.0X%
#      c1 + c2: X.XXXX ±0.0X%

Does anyone know how to do the same anova analysis but bayesian ?
Thank you so much in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文