我正在尝试构建这种类型的glmer模型:
glmer(MR~ Temperature*Elevation*Transect + Size + (1|Number_I), data=mortality2, family=binomial(link=logit))
响应变量对应于在研究growth生长时暴露于不同温度处理的of的死亡率。我将MR
计算为每个围栏的(enclosure死亡数量/实验开始时的number数量)。因此,MR值介于0到1之间。我最初以为使用Poisson系列,但我以百分比计算时,确实有Poisson无法处理的小数。然后,我阅读了一些讨论,并尝试使用family=binomial(link=logit)
。但是,我不确定这是我应该使用的家庭。而且,我收到以下错误消息错误:
Error in pwrssUpdate(pp, resp, tol = tolPwrss, GQmat = GQmat, compDev = compDev, :
Downdated VtV is not positive definite
In addition: Warning messages:
1: Some predictor variables are on very different scales: consider rescaling
2: In eval(expr, envir, enclos) :
non-integer #successes in a binomial glm!
我试图重新缩放变量'Number_I',但它没有任何改变。可变尺寸不是连续的,而是描述了两组尺寸:“ 4-5mm”或“ 6-7mm”。
我还尝试添加: control = glmerControl(optimizer =“ bobyqa”,optCtrl = list(maxfun = 2e5))
但是似乎错误消息变得最糟了:
Warning messages:
1: Some predictor variables are on very different scales: consider rescaling
2: In eval(expr, envir, enclos) :
non-integer #successes in a binomial glm!
3: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
unable to evaluate scaled gradient
4: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
Model failed to converge: degenerate Hessian with 2 negative eigenvalues
我的数据如下:
Transect Population Elevation Temperature Size Number_I Number_F Nbre_dead `Survival (%)`
<dbl> <chr> <dbl> <dbl> <chr> <dbl> <dbl> <dbl> <dbl>
1 1 ZHA 1600 15 4-5mm 7 5 2 71.42857
2 1 SEB 800 15 4-5mm 16 8 8 50.00000
3 1 JUB 200 15 4-5mm 15 8 7 53.33333
4 1 ZHA 1600 15 6-7mm 7 6 1 85.71429
5 1 SEB 800 15 6-7mm 3 2 1 66.66667
6 1 JUB 200 15 6-7mm 6 2 4 33.33333
SR Mortality.... MR Replicat
1 0.7142857 28.57143 0.2857143 1
2 0.5000000 50.00000 0.5000000 1
3 0.5333333 46.66667 0.4666667 1
4 0.8571429 14.28571 0.1428571 1
5 0.6666667 33.33333 0.3333333 1
6 0.3333333 66.66667 0.6666667 1
我可以使用family = binomial(link = logit)吗?如何使模型正常工作?
谢谢。