I have the following code:
model.xy <- lm(Y ~ X, Htest)
model.mx <- lm(M ~ X, Htest)
model.yxm <- lm(Y ~ X + M, Htest)
These regressions are doing fine (also summary view) but then when I want to check for mediation effect the code is getting an error.
results <- mediate(model.mx, model.yxm, treat='X', mediator='M', boot=TRUE, sims=500)
The code above used to work last week and now I keep getting:
Error in mediate(model.mx, model.yxm, treat = "X", mediator = "M", boot = TRUE, : unused arguments (treat = "X", mediator = "M", boot = TRUE, sims = 500)
Can someone please tell me what might be wrong? I have the required packages and all variables exist and I have no typos.. it really worked last week. I am really confused.
Thanks!