simsem/semTools

Error in reliability(fit) : argument "items" is missing, with no default

Closed this issue · 3 comments

scith commented

Hello, I had a syntax that was working perfectly fine before (with R version 3.6.1 and Lavaan version 0.65), in which I computed reliability on my model.

I have upgraded R to 4.3.1, lavaan to 0.6-15 and semTools to 0.5-6.920. The model (named "fit") is computed fine, along with the lavaan summary.

However, now the reliability function doesn't work anymore for me, and it displays:
Error in reliability(fit) : argument "items" is missing, with no default

Has something changed that may have created this?
Thanks

reliability() never had an items= argument, so I'm not sure what causes this. Perhaps a reproducible example would be informative (this is a common standard for posting issues).

Note also that I deprecated reliability() last year, replacing it with compRelSEM(). See its help page for details.

scith commented

Thanks for your reply. I am not sure. I tried isolating the issue by loading only the necessary packages.
I think the issue came because of the package "psych".
When I load psych after semTools, it says that "reliability" is hidden because of semTools, and then using "reliability" gives the above error message.

If I only load semTools without psych, I get this message instead:

Error in ly[[i]] %*% ve[[i]] : non-conformable arguments
In addition: Warning message:
In (apply(ly[[i]], 2, sum)^2) * diag(ve[[i]]) :
  longer object length is not a multiple of shorter object length

I did not notice reliability was deprecated sorry.
compRelSEM works indeed, so I guess the issue can be closed.

From my understanding, Cronbach's Alpha can still be retrieved by using "tau.eq=TRUE"?
But what about AVE?

Thanks, have a nice day

Indeed, the psych package has its own reliability() function that can conflict with semTools.

Cronbach's Alpha can still be retrieved by using "tau.eq=TRUE"?

Yes.

what about AVE?

That has never been a reliability estimate. There is a separate AVE() function now.