[Mediation-information] Error when using mediate function with lme4 models

Kosuke Imai kimai at Princeton.EDU
Tue Jan 21 17:03:06 CET 2014


Hi J-P, 
  
  We are currently looking into this and will get back to you as soon as possible. 

Thanks,
Kosuke

---------------------------------------------------------
Kosuke Imai               Office: Corwin Hall 036
Professor                 Phone: 609-258-6601
Department of Politics    Fax: 609-258-1110
Princeton University      Email: kimai at Princeton.Edu
Princeton, NJ 08544-1012  http://imai.princeton.edu
---------------------------------------------------------

On Jan 20, 2014, at 12:20 PM, Jean-Philippe Laurenceau <jlaurenceau at psych.udel.edu> wrote:

> Dear R mediation Folk—I would like to start by saying that I have been enjoying the functionality and flexibility of the mediation package that Kosuke, Dustin, Teppei, Luke, et al. have developed. Bravo and keep up the important work of disseminating this tool!
>  
> Nevertheless, I ran into a surprising error just this morning when running mediate on some lme4 data runs. It looks like an issue with the coding rather than my data because I get the same error when running the multilevel modeling example on the “jobs” data from the reference manual. This is what I get:
>  
> > model.m <- glmer(job_dich ~ treat + econ_hard + (1 | educ), family = binomial(link = "probit"), data = jobs)
> > model.y <- glmer(work1 ~ treat + job_dich + econ_hard + (1 + treat | occp), family = binomial(link = "probit"), data = jobs)
> > multilevel <- mediate(model.m, model.y, treat = "treat", mediator = "job_dich", sims=50, group.out="educ")
>  
> Error in mvrnorm(sims, mu = MModel.coef, Sigma = MModel.var.cov) :  incompatible arguments
>  
> I am still somewhat new to R, so any insights on what needs to be tweaked would be much appreciated.
>  
> Best, J-P
>  
> Jean-Philippe Laurenceau, Ph.D.
> Department of Psychology
> University of Delaware
> 110 Wolf Hall
> Newark, DE 19716-2577
> Voice: (302) 831-2309
> Fax: (302) 831-3645
> jlaurenceau at psych.udel.edu
>  
> _______________________________________________
> Mediation-information mailing list
> Mediation-information at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/mediation-information



More information about the Mediation-information mailing list