我想進行引導,以獲得我的固定效應的95%CI在二項式GLMM:計算的R中使用confint固定效應的CI
m <- glmer(cbind(df$Valid.detections, df$Missed.detections) ~ distance +
Habitat + Replicate + transmitter.depth + receiver.depth +
wind.speed + wtc + Transmitter + (1 | Unit) +
(1 | SUR.ID) + distance:Transmitter +
distance:Habitat + distance:transmitter.depth + distance:receiver.depth +
distance:wind.speed, data = df, family = binomial(link=logit),control=glmerControl(calc.derivs=F))
我發現confint()
功能是能夠做到這一點,所以我指定了功能:
confint(m, method = "boot", boot.type = "basic", seed = 123, nsim = 1000)
該函數在我決定終止之前已運行了8個多小時。協議終止後,我得到了返回下面的警告消息(X10):
Warning messages:
1: In (function (fn, par, lower = rep.int(-Inf, n), upper = rep.int(Inf, :
failure to converge in 10000 evaluations
我的問題是:1)我擔心這些警告消息?如果是這樣,我該如何處理它們?2)因爲8小時後它仍在運行我不知道執行此功能需要多長時間。因此,在執行此功能時有一些進度條會很好。我讀了confint()可以從bootMer接受參數,所以我包括參數.progress =「TXT」,導致:
confint(m, method = "boot", boot.type = "basic", seed = 123, nsim = 1000, .progress = "txt")
,但它似乎並沒有工作。或者,如果有更好的方法來實現相同的目標,我願意接受建議。
感謝所有幫助
在倒數第二句中,「似乎不起作用」是什麼意思?你需要加載'plyr'包 - 抱歉,如果不清楚。概況置信區間會更快,並且可能足夠準確。 – 2014-10-28 16:53:51
你也可以使用'parm'參數來限制你正在分析哪些參數(即跳過隨機效果參數......) – 2014-10-28 17:16:59
你可以增加最大迭代次數(參見'?glmerControl')以擺脫警告。您應該期望自舉時間與樣本數大致呈線性關係(即,只要首先擬合模型,1000個自舉樣本應該取1000倍的數量級,儘管內置了一些技巧以使其成爲快一點)。 – 2014-10-28 17:18:53