<font class="Apple-style-span" face="&#39;Times New Roman&#39;" size="3"><div>Hi Everyone,</div><div><br></div><div>I want to run the following model in which the treatment (Hg) is a spline function ( i.e. te(Hg)). The problem is in the model for mediate, the treat &#39;te(Hg)&#39; can not be recognized by the program. How can I solve this problem? </div>
<div><br></div><div><br></div><div>model.m=gam(WEIGHT~te(Hg)+BABY_SEX+parity,data=m)</div><div>model.y=gam(mr~WEIGHT+te(Hg)+ BABY_SEX, data=m,family=binomial(link=&quot;logit&quot;))</div><div>fit=mediate(model.m, model.y,sim=1000, boot=TRUE, treat=&#39;te(Hg)&#39;, mediator=&#39;WEIGHT&#39;)</div>
<div><br></div><div>Thanks a lot.</div><div><br></div><div>Sincerely,</div><div>Bao</div><div><br></div></font>