LMERConvenienceFunctions

LMERConvenienceFunctions

本文介绍了向后和向前拟合函数发生LMERConvenienceFunctions错误:模型不是mer对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用LMERConvenienceFunctions软件包中的bfFixefLMER_t.fncfitLMER.fnc.在这两种情况下,我都会收到一个错误消息,即输入模型不是mer对象".

I tried using bfFixefLMER_t.fnc or fitLMER.fnc from the LMERConvenienceFunctions package. In both the cases, I get an error that "the input model is not a mer object".

我尝试了 http://中的示例: //artax.karlin.mff.cuni.cz/r-help/library/LMERConvenienceFunctions/html/00Index.html .我遇到同样的错误.

I tried out the examples from http://artax.karlin.mff.cuni.cz/r-help/library/LMERConvenienceFunctions/html/00Index.html. I get the same errors.

例如,当我从示例运行时

For example when I run from the example

fitLMER.fnc(mB, backfit.on = "t", item = FALSE, 
    ran.effects = c("(FreqB | Subject)",
    "(LengthB | Subject)", "(WMC | Item)"))

这是我得到的结果.

Warning in fitLMER.fnc(mB, backfit.on = "t", item = FALSE, ran.effects = c("(FreqB | Subject)",  :resetting argument "method" to "t"

**backfitting fixed effects**

Warning in bfFixefLMER_t.fnc(model = model, item = item, method = method,  :factor variable with more than two levels in model terms, backfitting on t-values is not appropriate, please use function "bfFixefLMER_F.fnc" instead.

Error in bfFixefLMER_t.fnc(model = model, item = item, method = method,  : the input model is not a mer object

有人对这些功能有经验吗?

Has anyone had this experience with these functions?

有些功能可以向后拟合固定效果,而可以向后拟合随机效果.有没有一种方法可以对glmer模型的固定效果进行正向拟合?还是从统计意义上讲这是没有意义的?我正在进行生态建模,所以我对高级统计数据的了解并不多,因此,请有人可以更好地用外行的术语进行解释

There are functions that back fit fixed effects and forward fit random effects. Is there a way to do forward fitting of fixed effects for the glmer models? Or is this statistically meaningless? I am working on ecological modelling, so my understanding of advanced stats is not much, so, please, if someone can explain in layman's terms better

sessionInfo()

R版本3.0.1(2013-05-16)平台:x86_64-pc-linux-gnu(64位)

R version 3.0.1 (2013-05-16)Platform: x86_64-pc-linux-gnu (64-bit)

语言环境: [1] LC_CTYPE = zh_CN.UTF-8 LC_NUMERIC = C
[3] LC_TIME = en_US.UTF-8 LC_COLLATE = en_GB.UTF-8
[5] LC_MONETARY = en_US.UTF-8 LC_MESSAGES = en_GB.UTF-8
[7] LC_PAPER = C LC_NAME = C
[9] LC_ADDRESS = C LC_TELEPHONE = C
[11] LC_MEASUREMENT = zh_CN.UTF-8 LC_IDENTIFICATION = C

locale: [1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_GB.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_GB.UTF-8
[7] LC_PAPER=C LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

附带的基本软件包:[1]统计图形grDevices utils数据集方法基础

attached base packages:[1] stats graphics grDevices utils datasets methods base

其他附带的软件包:[1] LMERConvenienceFunctions_2.0 lme4_0.99999911-8
[3] RcppEigen_0.3.1.2.1 Rcpp_0.10.4
[5] Matrix_1.0-12点阵_0.20-23
[7] LCFdata_1.0

other attached packages:[1] LMERConvenienceFunctions_2.0 lme4_0.99999911-8
[3] RcppEigen_0.3.1.2.1 Rcpp_0.10.4
[5] Matrix_1.0-12 lattice_0.20-23
[7] LCFdata_1.0

通过名称空间(未附加)加载:[1] grid_3.0.1 MASS_7.3-28 minqa_1.2.1 nlme_3.1-111 rpart_4.1-2
[6] splines_3.0.1 tools_3.0.1

loaded via a namespace (and not attached):[1] grid_3.0.1 MASS_7.3-28 minqa_1.2.1 nlme_3.1-111 rpart_4.1-2
[6] splines_3.0.1 tools_3.0.1

推荐答案

您使用的是经过大修的lme4软件包的(旧)版本,该软件包返回merMod对象而不是mer对象,因此不兼容使用LMERConvenienceFunctions.使用即将发布的版本1.0-4时,我会遇到相同的错误.

You are using an (older) version of the overhauled lme4 package that returns merMod objects instead of mer objects, and hence is not compatible with LMERConvenienceFunctions. I get the same error when using the soon-to-be-released version 1.0-4.

如果我从CRAN安装了最新版本(0.999999-2),则不会出现任何错误.我建议删除当前的lme4并从CRAN安装最新的lme4,并检查其版本:

If I install the latest version from CRAN instead (0.999999-2), no errors arise. I suggest removing your current lme4 and installing the latest from CRAN, and checking its version:

> detach("package:lme4",unload=TRUE)
> remove.packages("lme4")
> install.packages("lme4")
> packageVersion("lme4")
[1] ‘0.999999.2’

这应该可以解决您的问题.但是请注意,您将失去新版本的优点.

This should fix your problems. Be aware, however, that you will lose the advantages of the new version.

此外,在以后的日子里,新的lme4应该会出现在CRAN上,如果更新软件包,则会再次破坏LMERConvenienceFunctions.但是,我想LMERConvenienceFunctions的作者将很快更新其程序包以使其再次兼容.

Also, in the coming days the new lme4 should appear on CRAN, breaking LMERConvenienceFunctions again if you update your packages. I guess, however, that the authors of LMERConvenienceFunctions will update their package soon to be compatible again.

这篇关于向后和向前拟合函数发生LMERConvenienceFunctions错误:模型不是mer对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-13 02:30