[Mediation-information] Multilevel analysis for complex surveys
Angel Rodriguez
angel.rodriguez at matiainstituto.net
Tue Aug 26 19:36:15 CEST 2014
Thank you very much, Kentaro.
Angel
-----Mensaje original-----
De: Kentaro Hirose [mailto:hirose at Princeton.EDU]
Enviado el: mar 26/08/2014 19:02
Para: Angel Rodriguez; mediation-information at r-forge.wu-wien.ac.at
Asunto: RE: Multilevel analysis for complex surveys
Hi Angel,
> I don't understand why in med.fit the term related to the clustering units is (1|SCH_ID), while (1 + attachment|SCH_ID) is the term in the out.fit.
This is just fitting a varying-intercept model for the mediator and a varying-intercept-and-slope model for the outcome. You could also fit two varying-intercept models for both the mediator and outcome. And similarly, you could also fit two varying-intercept-and-slope models for both the mediator and outcome. It's all up to your theory.
> My first question is if I should use mediation with glmer.
If your dependent variable is binary and you want to use a multilevel model, then you should use glmer.
Best,
Kentaro Hirose
Postdoctoral Fellow
Department of Politics
Princeton University
________________________________________
From: mediation-information-bounces at r-forge.wu-wien.ac.at [mediation-information-bounces at r-forge.wu-wien.ac.at] on behalf of Angel Rodriguez [angel.rodriguez at matiainstituto.net]
Sent: Tuesday, August 26, 2014 12:49 PM
To: mediation-information at r-forge.wu-wien.ac.at
Subject: [Mediation-information] Multilevel analysis for complex surveys
Dear subscribers,
I want to carry out a mediation analysis with variables collected in a survey (for more information, see the thread "causally dependent mediators"). It was a complex survey with strata and individuals clustered in census sections. I do not have census section variables, but I want the models to be aware that individuals are not independent because they're grouped in census sections.
My first question is if I should use mediation with glmer.
In that case, my second question would be about the syntax to carry out this. In the example in Tingley's "mediation: R Package for Causal Mediation Analysis", the proposed models are:
R> library(lme4)
R> set.seed(2014)
R> med.fit <- glmer(attachment ~ catholic + gender + income + pared + (1|SCH_ID),
+ family = binomial(link = "logit"), data = student)
R> out.fit <- glmer(fight ~ catholic*attachment +
+ gender + income + pared + (1 + attachment|SCH_ID),
+ family = binomial(link = "logit"), data = student)
I don't understand why in med.fit the term related to the clustering units is (1|SCH_ID), while (1 + attachment|SCH_ID) is the term in the out.fit.
Thank you very much,
Angel Rodriguez-Laso
Research Project Manager
Matia Instituto Gerontologico
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/mediation-information/attachments/20140826/38e4199b/attachment.html>
More information about the Mediation-information
mailing list