kosukeimai / mediation

R package mediation
61 stars 29 forks source link

Using test,modmed on mixed effect models #69

Open TanFuMiao opened 2 months ago

TanFuMiao commented 2 months ago

I am trying to compare the mediation effect between two levels of my moderator using test.modmed(). However, it does not seem to work on lmer() models.

test.modmed(modmed.model, covariates.1=list(sex=1), covariates.2=list(sex=0), sims = 5000) Error in test.modmed.default(modmed.model, covariates.1 = list(sex = 1), : currently no test.modmed method exists for the input object.

When I changed the model to lm(), it works fine, So I can't seem to figure out the issue.