<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle">P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
</style>
</head>
<body fPStyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<p>Dear list,</p>
<p> </p>
<p>Is it possible to do a mediation analysis in combination with an independent categorical (dummy)variable, something like this? How to calculate the mediation effect with respect to both dummy variables? Just include dummy1 first andf than dummy2 in model
c? I tried it with real data but the code below does not work? What is wrong? (define the variable as factor also does not solve it)</p>
<p> </p>
<p><font face="Courier New"># Model 1<br>
a <- glm(indep ~ dummy1 + dummy2, data=x, family=gaussian) <br>
b <- glm(mediator ~ dummy1 + dummy2, data=x, family=gaussian)<br>
c <- glm(indep outcome~ dummy1 + dummy2 + mediator, data=x, family=gaussian)</font></p>
<p><font face="Courier New">a<br>
b <br>
c<br>
<br>
med1.boot <- mediate(b, c, boot=TRUE, sims=1000, treat=c("dummy1", "dummy2"), mediator="mediator")<br>
summary(med1.boot)</font></p>
<p><font face="Courier New"></font> </p>
<p><font face="Courier New">Thanks for the response.</font></p>
<p><font face="Courier New"></font> </p>
<p><font face="Courier New">kind regards,</font></p>
<p><font face="Courier New"></font> </p>
<p><font face="Courier New">Martijn</font></p>
<p><font face="Courier New"></font> </p>
</div>
</body>
</html>