0

我正在计算贝叶斯方差分析来调查我的航向变量如何影响 FirstSteeringTime。这是我的数据集的示例:

x <- structure(list(FirstSteeringTime = c(0.433389999999999, 0.449999999999989, 
0.383199999999988, 0.499899999999997, 0.566800000000001, 0.58329999999998, 
0.5, 0.449799999999982, 0.566600000000022, 0.466700000000003, 
0.433499999999981, 0.466799999999978, 0.549900000000036, 0.483499999999992, 
0.533399999999972, 0.433400000000006, 0.533200000000022, 0.450799999999999, 
0.45022, 0.46651, 0.68336, 0.483400000000003, 0.5167, 0.383519999999997, 
0.583200000000005, 0.449999999999989, 0.58329999999998, 0.4999, 
0.5334, 0.4666, 0.433399999999978, 0.41670000000002, 0.416600000000017, 
0.45010000000002, 0.666700000000048, 0.433399999999949, 0.466700000000003, 
0.666600000000017, 0.516800000000046, 0.199900000000014, 0.400039999999997, 
0.150100000000009, 0.583399999999983, 0.483400000000017, 0.400099999999952, 
0.666600000000017, 0.434087937888119, 0.516692671379801, 0.533482992494996, 
0.516702632558399), pNum = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 10L, 10L, 10L, 10L), heading = structure(c(4L, 
1L, 4L, 3L, 4L, 3L, 4L, 3L, 4L, 1L, 4L, 4L, 4L, 4L, 4L, 3L, 3L, 
3L, 4L, 4L, 2L, 3L, 4L, 2L, 1L, 2L, 1L, 3L, 1L, 2L, 4L, 3L, 3L, 
4L, 2L, 4L, 4L, 1L, 3L, 4L, 3L, 4L, 3L, 3L, 2L, 3L, 2L, 2L, 2L, 
3L), .Label = c("0.5", "1", "1.5", "2"), class = "factor")), row.names = c(NA, 
50L), class = "data.frame")

首先我拟合我的贝叶斯方差分析模型:

op <- options(contrasts = c("contr.helmert", "contr.poly"))

fit_aov <- stan_aov(FirstSteeringTime ~ heading, data = x, prior = R2(0.5))

我的模型显示我有 4 个预测变量。这是正确的,因为我对标题变量的级别 - 0.5、1、1.5 和 2:


fit_aov

stan_aov
 family:       gaussian [identity]
 formula:      FirstSteeringTime ~ heading
 observations: 50
 predictors:   4
------
            Median MAD_SD
(Intercept) 0.5    0.0   
heading1    0.0    0.0   
heading2    0.0    0.0   
heading3    0.0    0.0   

Auxiliary parameter(s):
              Median MAD_SD
R2            0.1    0.1   
log-fit_ratio 0.0    0.1   
sigma         0.1    0.0   

ANOVA-like table:
                Median MAD_SD
Mean Sq heading 0.0    0.0   

Sample avg. posterior predictive distribution of y:
         Median MAD_SD
mean_PPD 0.5    0.0   

但是,当我计算我的实际等效区域 (ROPE) 区间并将其与我的 HDI 进行比较时,我似乎只显示了三个预测变量?

pd <- p_direction(fit_aov)
percentage_in_rope <- rope(fit_aov, ci = 1)

# Visualise the pd
plot(pd)

pd

 Parameter      pd
   (Intercept) 100.00%
      heading1  80.35%
      heading2  79.47%
      heading3  98.78%
 log-fit_ratio  60.48%
            R2 100.00%

方向概率的 HDI 现在我的第一个想法是,一个级别的航向变量可能会产生非常小的影响,因此它不足以创建 HDI?但我不确定。有人有什么想法吗?也有人可以向我解释一下 log-fit ratio/R2 是什么以及他们告诉我什么信息?

非常感谢任何帮助!

4

1 回答 1

0

经过一番思考,也许不同的 HDI 对应于积累数据和重建我的 HDI 的顺序性质?即,我从一个级别的预测器开始,然后为每个 HDI 添加另一个级别。当我添加它们时,我的 HDI 会变小,因为我可以对效果大小参数的可能值更有信心?只是我的一些想法。

于 2019-11-06T14:47:53.440 回答