lme4 :: glmer中的错误消息: “什么"必须是字符串或函数“ [英] Error message in lme4::glmer: " 'what' must be a character string or a function"
问题描述
我正在运行一个多级模型.我使用以下命令,以validatedRS6
作为结果,以random
作为预测变量,并使用clustno
作为随机效应变量.
new<-as.data.frame(read.delim("BABEX.dat", header=TRUE))
install.packages("lme4")
library(lme4)
model1<- glmer(validatedRS6 ~ random + (1|clustno), data=new, family=binomial("logit"), nAGQ = 1L)
但是,出现以下错误
do.call(new,c(list(Class ="glmResp",family = family),ll [setdiff(names(ll),: 'what'必须是字符串或函数
我绝对不知道出了什么问题,已经在互联网上搜索了.很抱歉,但是我无法提供数据,因为它来自尚未发布的干预措施.
(从注释扩展).
恭喜,您在lme4
中发现了一个错误!现在已解决:
https://github.com/lme4/lme4/commit/9c12f002821f9567d5454e2ce3b78076dabff /p>
这是由于在全局环境中有一个名为 您可以使用 I am running a multi-level model. I use the following commands with However, I get the following error Error in do.call(new, c(list(Class = "glmResp", family = family), ll[setdiff(names(ll), :
'what' must be a character string or a function I have absolutely no idea what has gone wrong and have searched the internet. I am sorry but I cannot provide the data as it is from an intervention which has yet to be published. (expanded from comment). Congratulations, you found a bug in https://github.com/lme4/lme4/commit/9c12f002821f9567d5454e2ce3b78076dabffb54 It is caused by having a variable called You can install a patched version from Github using 这篇关于lme4 :: glmer中的错误消息: “什么"必须是字符串或函数“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!new
的变量引起的(深入代码内,lme4
使用do.call(new,...)
并找到了变量new
而不是内置函数devtools::install_github()
从Github安装补丁版本(但需要编译工具等).或者,有一个非常简单的解决方法-只需将变量调用new
以外的任何其他名称即可(您不能仅复制它,即new2 <- new
,还必须确保已删除旧版本(rm("new")
)).validatedRS6
as the outcome, random
as the predictor and clustno
as the random effects variable.new<-as.data.frame(read.delim("BABEX.dat", header=TRUE))
install.packages("lme4")
library(lme4)
model1<- glmer(validatedRS6 ~ random + (1|clustno), data=new, family=binomial("logit"), nAGQ = 1L)
lme4
! This is fixed now:new
in the global environment (deep in the guts of the code, lme4
uses do.call(new,...)
and finds your variable new
rather than the built-in function new
).devtools::install_github()
(but you'll need compilation tools etc.). Alternately, there is a very simple workaround -- just call your variable anything other than new
(you can't just copy it, i.e. new2 <- new
-- you also have to make sure the old version is removed (rm("new")
)).