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

Time:03-05

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.

CodePudding user response:

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

  • Related