lme 找不到设置相关/协方差结构和权重的函数

发布于 2025-01-11 16:56:04 字数 739 浏览 0 评论 0 原文

我目前正在尝试拟合多元混合模型。

我试图包含权重和协方差结构,如下所示:

model <- nlme::lme(fixed = ..., data = ...., 
   random = ..., weights = varIdent(form = ~ 1 | Gender))

或者

model <- nlme::lme(fixed = ..., data = ...., random = ..., corr = corAR1())

我也尝试使用 correlation 而不是 corr

但是,我收到错误消息:

corAR1() 中的错误:找不到函数“corAR1”

varIdent(form = ~1 | Gender) 中的错误:找不到函数“varIdent”

我尝试删除全局环境并加载所有新鲜内容。 我还重新安装了 nlme 并按照 getAnywhere(corAR1) 和 getAnywhere(varIdent)。 com/questions/51501657/r-cant-find-function">这篇文章

I'm currently trying to fit a multivariate mixed model.

I'm trying to include weights and a covariance structure like so:

model <- nlme::lme(fixed = ..., data = ...., 
   random = ..., weights = varIdent(form = ~ 1 | Gender))

or

model <- nlme::lme(fixed = ..., data = ...., random = ..., corr = corAR1())

I also tried using correlation instead of corr.

However, I get error messages:

Error in corAR1() : could not find function "corAR1"

Error in varIdent(form = ~1 | Gender) : could not find function "varIdent"

I have tried deleting the global environment and loading everything fresh.
I also reinstalled nlme and typed getAnywhere(corAR1) and getAnywhere(varIdent) as suggested in this post.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半步萧音过轻尘 2025-01-18 16:56:05

你在运行之前调用library(nlme)吗?您是否尝试在调用本身中包含 nlme::corAR1()/nlme::varIdent()

Do you call library(nlme) before running? And did you try including nlme::corAR1()/nlme::varIdent() inside the call itself ?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文