PiecewiseSEM - Error in cbind(ret, isSig(ret[, 5])) : object 'ret' not found

180 Views Asked by At

I'm trying to run a path analysis using the piecewiseSEM package. When I try to run summary or coefs(), I get this error:

Error in cbind(ret, isSig(ret[, 5])) : object 'ret' not found 

or:

Error in cbind(ret, isSig(ret[, 5])) : object 'ret' not found

I have no idea what "object ret is. There is nothing in my code named "ret". My spelling is correct. All I have is a model list I called "mod" with two mixed models. The codes I tried to use are below:

mod <- psem(modn, modm)

summary(mod, standardize = "scale", conserve = TRUE)

#####

coefs(mod)

I have to run this as soon as possible and there is no one else to help me. I would really appreciate any comments. Please remember I'm not a skilled programmer so, I'll quote Michael Scott: "Explain this to me like I'm five." lol

Thank you.

modn<-lmer(Nestedness ~ (Category+Prop_ex+Connectance+Assimetry+N_Pol+N_Pla+Dist_eq) + (1|Eco_code), data = sem)
modm<-lmer(Modularity ~ (Category+Connectance+Assimetry+Prop_ex+Dist_eq+N_Pla+N_Pol) + (1|Eco_code),data = sem)

#try 1
mod <- psem(
  lmer(Nestedness ~ (Category+Prop_ex+Connectance+Assimetry+N_Pol+N_Pla+Dist_eq) + (1|Eco_code), data = sem),
  lmer(Modularity ~ (Category+Connectance+Assimetry+Prop_ex+Dist_eq+N_Pla+N_Pol) + (1|Eco_code),data = sem),
  
  data = sem)
  
   coefs(mod)

#try2

mod <- psem(modn, modm)

summary(mod, standardize = "scale", conserve = TRUE)

Resulting error:

Error in cbind(ret, isSig(ret[, 5])) : object 'ret' not found
in cbind(ret, isSig(ret[, 5])) : object 'ret' not found
1

There are 1 best solutions below

0
On

Run into the same error message when using lmer objects with piecewise sem. The problem was solved, when i used the development version (2.3.0) of piecewise sem.

library(devtools)
install_github("jslefche/piecewiseSEM@devel", build_vignette = TRUE)
library(piecewiseSEM)

See details: https://github.com/jslefche/piecewiseSEM/issues/270