<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1">
<TITLE>Multilevel analysis for complex surveys</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Dear subscribers,<BR>
<BR>
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.<BR>
<BR>
My first question is if I should use mediation with glmer.<BR>
<BR>
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:<BR>
<BR>
<BR>
R> library(lme4)<BR>
R> set.seed(2014)<BR>
R> med.fit <- glmer(attachment ~ catholic + gender + income + pared + (1|SCH_ID),<BR>
+ family = binomial(link = "logit"), data = student)<BR>
R> out.fit <- glmer(fight ~ catholic*attachment +<BR>
+ gender + income + pared + (1 + attachment|SCH_ID),<BR>
+ family = binomial(link = "logit"), data = student)<BR>
<BR>
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.<BR>
<BR>
Thank you very much,<BR>
<BR>
Angel Rodriguez-Laso<BR>
Research Project Manager<BR>
Matia Instituto Gerontologico<BR>
</FONT>
</P>

</BODY>
</HTML>