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

lme can't find functions to set correlation / covariance structure and weights

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

我正在尝试包括权重和协方差结构,如下所示:

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

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

我也尝试使用 correlation 而不是 corr

但是,我收到错误消息:

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

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

我试过删除全局环境并重新加载所有内容。 我还重新安装了 nlme 并按照 this post.

中的建议输入了 getAnywhere(corAR1)getAnywhere(varIdent)

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