[Mediation-information] Problems with 2-2-1 mediation model
Kentaro Hirose
hirose1981 at gmail.com
Wed Sep 28 04:10:23 CEST 2016
Hi Raj,
I think the error is coming from a data problem. We need to create
different data sets when analyzing a 2-2-1 model. Please refer our JSS
paper (p.19) to deal with this problem.
http://imai.princeton.edu/research/files/mediationR2.pdf#search='JSS+mediation
'
Best,
Kentaro
2016-09-28 10:48 GMT+09:00 Shivraj Kanungo <kanungo at gwu.edu>:
> Here is my setup for a 2-2-1 multilevel mediation model
>
> # ============================================================
> =============
> # 2-2-1 mediation
> # ============================================================
> =============
> med.fit <- lm(GP.g ~ MF.g + TE.g + size, data =
> dat_simple)
> out.fit <- lmer(IP ~ MF.g + GP.g + TE.g + size + (1|gId), data =
> dat_simple)
> med.out <- mediate(med.fit, out.fit, treat = "MF.g", mediator = "GP.g",
> control.value = 3, treat.value = 4, sims = 100)
> summary(med.out)
>
>
> and here is the output (I searched the web and could not find this error)
>
> > med.fit <- lm(GP.g ~ MF.g + TE.g + size, data =
> dat_simple)
> > out.fit <- lmer(IP ~ MF.g + GP.g + TE.g + size + sex + (1|gId), data =
> dat_simple)
> > med.out <- mediate(med.fit, out.fit, treat = "MF.g", mediator = "GP.g",
> + sims = 100)
> Error in mediate(med.fit, out.fit, treat = "MF.g", mediator = "GP.g", :
> groups do not match between mediator and outcome models
>
>
> Any help is welcome ... Thanks a ton
> Raj
>
> --
> Shivraj Kanungo
> *http://home.gwu.edu/~kanungo <http://home.gwu.edu/~kanungo>*
> Department of Decision Sciences
> The George Washington University
> Funger Hall 415E, 2201 G St NW
> Washington, DC 20052
> (202) 994 3734 (Office)
> (202) 994 2736 (Fax)
>
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/mediation-information/attachments/20160928/1338fcb7/attachment.html>
More information about the Mediation-information
mailing list