kosukeimai / mediation

R package mediation
58 stars 29 forks source link

mediate not compatible with lmerTest package #34

Open StefanMarian1 opened 3 years ago

StefanMarian1 commented 3 years ago

The mediate function does not work when package lmerTest is loaded, because lmerTest changes the class of the model from lmerMod to lmerModLmerTest. The function returns the error: mediator model is not yet implemented

Can the function be upgraded to be compatible with lmerTest package? Thanks

ducpq91 commented 2 years ago

Just use the model with lmer from lme4 and use that with mediate(). The lmer function from lme4 is the same model as the one from lmerTest. The lmer function from lmerTest only gives you the additional p values and those are not required for mediate() to work.