1
當which
選項設置爲which = 'all'
時,我不完全清楚merTools::predictInterval
函數對每個組件的精確預測。例如,merTools中的組件含義:: predictInterval
library(lme4)
library(merTools)
fm1 <- lmer(Reaction ~ Days + (1 | Subject), sleepstudy)
pred <- predictInterval(fm1, which = 'all')
pred[pred$obs == 1,]
回報
effect fit upr lwr obs
1 combined 293.6893 335.0569 249.310016 1
181 Subject 40.6980 82.8388 -4.490277 1
361 fixed 251.2517 292.0853 212.230277 1
我假定適合固定效應和適合的隨機效應議題將加起來適合的綜合效應。但是,我得到:
> sum(pred[pred$obs == 1 & pred$effect %in% c('fixed','Subject'),]$fit)
[1] 291.9497
我在這裏錯誤地解釋了什麼?