1

我正在拟合一个逻辑二项式模型,其中响应变量是在特定时间段内查看目标图片的次数与在该期间查看所有图片的次数之和(总和 | 试验(N) 〜x)。根据brms文档,这种响应变量属于“附加项”。模型估计是合理的并且拟合良好,但后验预测检查不如我将常规逻辑二项式模型拟合到相同数据但未聚合(y ~ x)。下面是两个模型的虚拟示例。

我的问题是:

  • 加法项模型的后验预测检查实际上还不错,但预计它不会像常规模型那样干净吗?如果是这样,为什么?
  • 出于好奇,有没有办法在二项式尺度上对加法项模型进行预测检查,而不是预测“总和”?
# fake data

## long format
(dat_long <- data.frame(
  subj = rep(1:10, each = 100),
  item = rep(1:10, each = 10),
  bin  = rep(1:10, times = 10),
  cond = c(-.5,.5),
  pTarget = rbinom(1000, 1, .6)
))

## aggregated over bins/items
(dat_aggregated <- dat_long %>%
  dplyr::group_by(subj, cond) %>%
  dplyr::summarise(sum = sum(pTarget), N = length(pTarget)))


# model using addition-terms
m_aggregated <- brm(formula = sum | trials(N) ~ cond,
                     family = binomial(),
                     iter = 5000,
                     prior = priors,
                     data =  dat_aggregated)

# regular model
m_long <- brm(formula = pTarget ~ cond,
                   iter = 1000,
                   family = binomial(),
                   prior = priors,
                   data =  dat_long)


# posterior predictive checks
pp_check(m_aggregated)
pp_check(m_long)

pp_check 绘图:

附加项模型的pp_check

pp_check 常规模式

4

0 回答 0