I am working on a package that takes user input and within its functions, uses lme4 to fit and return a "merMod" object.
I tried to pass these models to mediate and was getting a "mediator model is not yet implemented" error. Poking through the source code, I see why. There are a series of if statements like
if(isMer.m && getCall(model.m)[[1]]=="lmer")
The models I've passed it, though, have a different 1st element, such that getCall(model.m)[[1]] would be "lme4::lmer" rather than "lmer". Of course, mediate has the technical capacity to fit these models but just doesn't recognize them for what they are.
I think it may be as simple of a fix as changing the if statements to something like
I am working on a package that takes user input and within its functions, uses lme4 to fit and return a "merMod" object.
I tried to pass these models to mediate and was getting a "mediator model is not yet implemented" error. Poking through the source code, I see why. There are a series of if statements like
The models I've passed it, though, have a different 1st element, such that
getCall(model.m)[[1]]
would be"lme4::lmer"
rather than"lmer"
. Of course, mediate has the technical capacity to fit these models but just doesn't recognize them for what they are.I think it may be as simple of a fix as changing the if statements to something like