我正在尝试为我的一些模型获取 AICc 表,这些模型是使用包 glmmTMB 构建的。该模型给出了一个 logLik 值,但没有给出 AICc。当我将模型放入 AICc() 时:
a <- print(AICc(model, trace = TRUE,
rank = "AICc", REML = FALSE))
我收到此错误:
Error in UseMethod("logLik") :
no applicable method for 'logLik' applied to an object of class "logical"
我使用了其他函数,如 AICtab() 并得到了同样的错误,所以我相信它在模型本身中。如果有人能够在这里解释此错误,请告诉我,谢谢。
编辑:
使用的最小数据集和模型:
ID <- c("A","B","C","A","B","C","A","B","C","A","B","C")
#random effect
Sesh <- c("A1","B1","C1","A2","B2","C2","A3","B3","C3","A4","B4","C4")
#nested random effect
Stim <- c("Old","New","Old","New","Old","New","Old","New","Old","New","Old","New")
Temp <- c(75, 76, 72, 80, 71, 65, 69, 60, 76, 80, 81, 60)
Total <- c(0,1,5,6,3,10,2,1,0,0,4,6)
z <- data.frame(ID, Sesh, Stim, Temp, Total)
m <- glmmTMB(
Total ~ Stim + Temp + (1|ID/Sesh),
ziformula = ~1,
data = z,
family = nbinom2)