简体   繁体   English

在家庭=高斯(身份链接)的 glmer() 中调用错误

[英]Calling error in glmer() with family=gaussian (identity link)

I am trying to fix a glmm for a dataframe with 53 obs.我正在尝试为具有 53 个 obs 的数据框修复 glmm。 of 17 variables. 17 个变量。 All variables are standardized, but don't follow the normal distribution and have no missing values.所有变量都是标准化的,但不遵循正态分布且没有缺失值。 The str() of the data frame is something like below.数据框的 str() 如下所示。

  • species : Factor w/ 19 levels "spp1","spp2",..: 5 18 12 15 19 4 6 14 16 5 ...物种:因子 w/ 19 水平“spp1”,“spp2”,..:5 18 12 15 19 4 6 14 16 5 ...
  • association : Factor w/ 4 levels "assoA","assoB",..: 1 1 2 2 2 3 3 4 4 1 ...关联:因子 w/ 4 个级别“assoA”,“assoB”,..:1 1 2 2 2 3 3 4 4 1 ...
  • site : Factor w/ 2 levels "site1","site2": 1 1 1 1 1 1 1 1 1 2 ...站点:因子 w/ 2 个级别 "site1","site2": 1 1 1 1 1 1 1 1 1 2 ...
  • obs.no : int 1 1 1 1 1 1 1 1 1 1 ... obs.no : int 1 1 1 1 1 1 1 1 1 1 ...
  • trait1: num 0.652 0.428 0.535 0.389 0.486 ...特征1:数字0.652 0.428 0.535 0.389 0.486 ...
  • trait2 : num 0.135 0.16 0.134 0.142 0.159特征2:数量 0.135 0.16 0.134 0.142 0.159
  • (clipped trait3 to 13) (剪裁 trait3 到 13)

I executed the following code to check the significance between sites an association classes for the given trait.我执行了以下代码来检查站点之间的重要性以及给定特征的关联类。

model1= glmer(trait1 ~ association+site+ (1 | species),data=df6,family=gaussian)

and received the error given below.并收到下面给出的错误。

In glmer(trait1 ~ association+site+ (1 | species),data=df6, : calling glmer() with family=gaussian (identity link) as a shortcut to lmer() is deprecated; please call lmer() directly在 glmer(trait1 ~ association+site+ (1 | species),data=df6, : 不推荐使用 family=gaussian (身份链接) 调用 glmer() 作为 lmer() 的快捷方式;请直接调用 lmer()

After this I want to estimate parameters with Gauss-Hermite quadrature.在此之后,我想用 Gauss-Hermite 正交估计参数。 Any recommendation to fix this error and code to execute Gauss-Hermite quadrature is very much appreciated.非常感谢任何修复此错误和执行 Gauss-Hermite 正交的代码的建议。

You actually posted the answer.您实际上发布了答案。 Use lmer, not glmer:使用 lmer,而不是 glmer:

model1 = lmer(trait1~association+site+(1|species), data=df6)

Clarifying: the reason that glmer(..., family = gaussian(link = "identity")) is not allowed (and that lme4 insists you use lmer(...) instead) is that there is no point using numerical (Gauss-Hermite) quadrature for a linear mixed model (which is exactly the special case of a GLMM with a Gaussian response and an identity link);澄清: glmer(..., family = gaussian(link = "identity"))的原因(并且lme4坚持你使用lmer(...)代替)是没有意义使用数字(高斯-Hermite)线性混合模型的求积(这正是具有高斯响应和恒等链接的 GLMM 的特例); in this case the integral can be expressed in closed form as a penalized least-squares problem (conditional on the random-effects variance/covariance parameters): seeBates et al.在这种情况下,积分可以以封闭形式表示为惩罚最小二乘问题(以随机效应方差/协方差参数为条件):参见Bates 等人。 2015 . 2015 年

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM