You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用MuMIn包dredge()调用lmer模型时出现“找不到lmer函数”错误

lmer模型调用dredge()报错问题
  • 加载lme4与MuMIn包后,执行以下代码拟合混合效应模型,运行无异常:
library(lme4)
library(MuMIn)

fm1 <- lmer(Y ~ X1 + X2 + (1 | X3), data = df_main)
  • 但执行main_dredge <- dredge(fm1)时,反复抛出系列错误:

could not find function "lmer" (model 0 skipped)
could not find function "lmer" (model 1 skipped)
.
.
.
Error in .dredge.par(global.model = fm1) :
the result is empty

  • 已尝试多种混合效应模型类型、并行版dredge(),均出现相同错误;但使用base包lm()拟合的模型调用dredge()(无论并行/非并行)均可正常运行。

环境信息

  • R版本:4.2.2 (2022-10-31 ucrt)
  • RStudio版本:2022.7.2.576

内容的提问来源于stack exchange,提问作者brabont

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.10 13:01:19