LMERConvenienceFunctions error on back and forward fitting functions: model not a mer object

点点圈 提交于 2019-12-12 15:44:55

问题


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".

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)"))

this is the result I get.

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?

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 version 3.0.1 (2013-05-16) Platform: x86_64-pc-linux-gnu (64-bit)

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

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

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

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


回答1:


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.

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.

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.



来源:https://stackoverflow.com/questions/18791725/lmerconveniencefunctions-error-on-back-and-forward-fitting-functions-model-not

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!