From kimai at Princeton.EDU Mon Dec 2 01:06:58 2013 From: kimai at Princeton.EDU (Kosuke Imai) Date: Mon, 2 Dec 2013 00:06:58 +0000 Subject: [Mediation-information] Mediation package in R In-Reply-To: References: Message-ID: <454312B8-F9D7-40D9-86E6-FF31D3D6AB4D@princeton.edu> We have some R code for mixed effects models from lmer4 but unfortunately we haven?t implemented coxme. We may try it but at the minimum it will take a month or so. The general algorithm is described in http://imai.princeton.edu/research/BaronKenny.html If you know some basic statistical programming, you should be able to implement this algorithm for any statistical model. Best, 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 Dec 1, 2013, at 6:25 PM, Tiago Almeida > wrote: Dear Dr. Imai, I am statistician from Brazil and I'm helping some people using the mediation package. They are trying to use survival mixed effect models (coxme) but this is not in the mediate function already. I'd like to know if you have plans for implement it, if you don't, I could try to implement, but I would need some help with this. Could you orient me to do this? I mean, where should I start looking: article, R code? Thank you, Tiago -------------- next part -------------- An HTML attachment was scrubbed... URL: From kimai at Princeton.EDU Wed Dec 4 04:48:48 2013 From: kimai at Princeton.EDU (Kosuke Imai) Date: Wed, 4 Dec 2013 03:48:48 +0000 Subject: [Mediation-information] Mediation In-Reply-To: References: Message-ID: Hi Gabriel, The multilevel model would account for over-time correlation within a country (though it does not recognize time sequence). If that?s okay with you, then you could go with the multilevel model, which is available in our mediation package. Unfortunately, the current version of our package does not have other types of models that can handle panel data. Best, 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 Dec 3, 2013, at 7:59 AM, Gabriel Cepaluni > wrote: Dear Prof. Imai, I recently read some of your papers on causal mediation and am learning how to use your R package. Congratulations for your excellent and inspiring work. I was wondering if you could advise me. I have a panel data of countries that are WTO members. I want to understand what motivates them to join into coalitions at the WTO negotiations. My main independent variable is GDP and my mediator is the number of diplomats in Geneva. This is a observational study. I'm arguing that large economies join coalitions more often because they can pay for the high transaction costs of negotiating at the WTO (number of diplomats is a proxy of bureaucratic capability). Joining into coalitions was measure either as a count and a dichotomous dependent variable. My question is: What outcome statistical model do you think is more appropriated for my data? I have tried linear and probit models. However, I don't want to lose all the temporal information I have. I also considered using a multilevel model, but I wasn't sure if this is the most appropriate mediation model. Thank you so much for your time. Best, -- Gabriel Cepaluni Professor de Rela??es Internacionais Assistant Professor of International Relations Unesp-Franca -------------- next part -------------- An HTML attachment was scrubbed... URL: From senor_massao at hotmail.com Thu Dec 5 02:50:35 2013 From: senor_massao at hotmail.com (Mashhood Sheikh) Date: Thu, 5 Dec 2013 01:50:35 +0000 Subject: [Mediation-information] Interaction between exposures? In-Reply-To: <8EDD92A6-D2F3-4A25-9398-17CD569DFE25@Princeton.Edu> References: , , <8EDD92A6-D2F3-4A25-9398-17CD569DFE25@Princeton.Edu> Message-ID: Dear Kosuke, Thank you very much for the reply. Please, let me confirm if I understand it correctly. You mean making a four category variables out of the two binary exposure variables as: Reference: where X1=0 AND X2=0 Dummy1:?where X1=1 AND X2=0 Dummy2:?where X1=0 AND X2=1 Dummy3: where X1=1 AND X2=1 This means I will be running three mediation models (3 dummy's against the reference), and will get three natural direct, natural indirect, and total effects? That is if all the three comparisons are important??Please confirm. Is there any solution about estimating one direct/indirect/total effect in a situation like this? Thankfully, Mashhood Institute of Community Medicine, University of Troms?, Norway. > From: kimai at Princeton.EDU > To: senor_massao at hotmail.com > CC: mediation-information at r-forge.wu-wien.ac.at > Subject: Re: [Mediation-information] Interaction between exposures? > Date: Sat, 30 Nov 2013 02:53:23 +0000 > > You can think of it as the four-category exposure. Now, the definition of indirect effects is a little bit different: in Y(t,M(t)) - Y(t,M(t?)) you have to pick t and t?. In the binary treatment case, this choice is obvious because there are only two values; t=1, t?= 0. When you have four category exposure, depending on your substantive question, you can pick different comparisons. > > Best, > Kosuke > > Department of Politics > Princeton University > http://imai.princeton.edu > > On Nov 28, 2013, at 7:19 AM, Mashhood Sheikh wrote: > >> Dear Dustin and Kosuke, >> >> Is it possible to estimate the direct and indirect effects when there is an interaction between exposures (X1, X2), regressed on outcome Y? Since X2 is also a mediator-outcome confounder between the mediation model X1>M>Y, and X1 is also a mediator-outcome confounder between the mediation model X2>M>Y, it is important to include them in the model as covariates, but than what about the interaction between them? Note: all variables, X1, X2, M, and Y are binary. >> >> I would highly appreciate any tips... >> >> >> Thankfully, >> Mashhood >> Institute of Community Medicine, >> University of Troms?, >> Norway. >> _______________________________________________ >> 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 > From kimai at Princeton.EDU Mon Dec 9 21:18:21 2013 From: kimai at Princeton.EDU (Kosuke Imai) Date: Mon, 9 Dec 2013 20:18:21 +0000 Subject: [Mediation-information] Interaction between exposures? In-Reply-To: References: , , <8EDD92A6-D2F3-4A25-9398-17CD569DFE25@Princeton.Edu> Message-ID: <289C0F60-BA15-427E-B71E-D2CE77B315AD@Princeton.Edu> Yes, exactly. Which comparison is most important depends on your substantive questions, though. Best, Kosuke Department of Politics Princeton University http://imai.princeton.edu On Dec 4, 2013, at 8:50 PM, Mashhood Sheikh wrote: > Dear Kosuke, > > Thank you very much for the reply. Please, let me confirm if I understand it correctly. You mean making a four category variables out of the two binary exposure variables as: > > Reference: where X1=0 AND X2=0 > Dummy1: where X1=1 AND X2=0 > Dummy2: where X1=0 AND X2=1 > Dummy3: where X1=1 AND X2=1 > > This means I will be running three mediation models (3 dummy's against the reference), and will get three natural direct, natural indirect, and total effects? That is if all the three comparisons are important? Please confirm. > > Is there any solution about estimating one direct/indirect/total effect in a situation like this? > > > > Thankfully, > Mashhood > Institute of Community Medicine, > University of Troms?, > Norway. > > > >> From: kimai at Princeton.EDU >> To: senor_massao at hotmail.com >> CC: mediation-information at r-forge.wu-wien.ac.at >> Subject: Re: [Mediation-information] Interaction between exposures? >> Date: Sat, 30 Nov 2013 02:53:23 +0000 >> >> You can think of it as the four-category exposure. Now, the definition of indirect effects is a little bit different: in Y(t,M(t)) - Y(t,M(t?)) you have to pick t and t?. In the binary treatment case, this choice is obvious because there are only two values; t=1, t?= 0. When you have four category exposure, depending on your substantive question, you can pick different comparisons. >> >> Best, >> Kosuke >> >> Department of Politics >> Princeton University >> http://imai.princeton.edu >> >> On Nov 28, 2013, at 7:19 AM, Mashhood Sheikh wrote: >> >>> Dear Dustin and Kosuke, >>> >>> Is it possible to estimate the direct and indirect effects when there is an interaction between exposures (X1, X2), regressed on outcome Y? Since X2 is also a mediator-outcome confounder between the mediation model X1>M>Y, and X1 is also a mediator-outcome confounder between the mediation model X2>M>Y, it is important to include them in the model as covariates, but than what about the interaction between them? Note: all variables, X1, X2, M, and Y are binary. >>> >>> I would highly appreciate any tips... >>> >>> >>> Thankfully, >>> Mashhood >>> Institute of Community Medicine, >>> University of Troms?, >>> Norway. >>> _______________________________________________ >>> 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 >> > _______________________________________________ > 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