簡體   English   中英

兩個隨機截取時的 ggcoef_model 錯誤

[英]ggcoef_model error when two random intercepts

當試圖用 GGally 中的兩個隨機截距GGally glmmTMB模型的條件固定效應時,我得到了錯誤:

調用“tidy_fun()”時出錯。 這很可能是因為“tidy_fun=”中提供的函數拼寫錯誤、不存在、與您的對象不兼容或缺少必要的參數(例如“conf.level=”或“conf.int=”)。 請參閱下面的錯誤消息。 錯誤:“stop_vctrs()”中的錯誤:! 無法回收“..1”(尺寸 3)以匹配“..2”(尺寸 2)。`

我已經解決了這個問題,它似乎與模型中包含的兩個隨機截距有關。 我還嘗試通過broom.mixed::tidy分別提取系數和標准誤差信息,然后將數據框輸入GGally:ggcoef()無濟於事。 有什么建議么?

# Example with built-in randu data set
data(randu)
randu$A <- factor(rep(c(1,2), 200))
randu$B <- factor(rep(c(1,2,3,4), 100))

# Model
test <- glmmTMB(y ~ x + z + (0 +x|A) + (1|B), family="gaussian", data=randu)

# A few of my attempts at graphing--works fine when only one random effects term is in model
ggcoef_model(test)

ggcoef_model(test, tidy_fun = broom.mixed::tidy)

ggcoef_model(test, tidy_fun = broom.mixed::tidy, conf.int = T, intercept=F)

ggcoef_model(test, tidy_fun = broom.mixed::tidy(test, effects="fixed", component = "cond", conf.int = TRUE))

最近修復了一些(舊的!)錯誤(此處此處),這會使任何具有多個隨機項的模型的 RE 參數置信區間報告中斷(我認為)。 我相信,如果您能夠安裝glmmTMBglmmTMB的更新broom.mixed

remotes::install_github("glmmTMB/glmmTMB/glmmTMB@ci_tweaks")
remotes::install_github("bbolker/broom.mixed")

然后ggcoef_model(test)將起作用。

在此處輸入圖像描述

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM