From kanungo at gwu.edu Wed Sep 28 03:48:49 2016 From: kanungo at gwu.edu (Shivraj Kanungo) Date: Tue, 27 Sep 2016 21:48:49 -0400 Subject: [Mediation-information] Problems with 2-2-1 mediation model Message-ID: 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 * 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) -------------- next part -------------- An HTML attachment was scrubbed... URL: From hirose1981 at gmail.com Wed Sep 28 04:10:23 2016 From: hirose1981 at gmail.com (Kentaro Hirose) Date: Wed, 28 Sep 2016 11:10:23 +0900 Subject: [Mediation-information] Problems with 2-2-1 mediation model In-Reply-To: References: Message-ID: 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 : > 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 * > 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: