<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I perform a mediation analysis using multiple mediators and covariates in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-perform-a-mediation-analysis-using-multiple-mediators/m-p/647600#M31079</link>
    <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/328706"&gt;@Therese2&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I probably don't know the vocabulary of your field well enough.&amp;nbsp; When you say "covariate" do you mean a categorical variable of some sort? The reason I ask is that Example 2 has SES as a continuous predictor in PROC LOGISTIC.&amp;nbsp; If you had a categorical variable, you could enter it in the MODEL statement and in a CLASS statement. The only drawback I see right off the top is that when a continuous mediator is modeled, the example uses PROC REG, which unfortunately does not support the CLASS statement.&amp;nbsp; You would probably have to substitute PROC GLM to include the categorical covariate.&amp;nbsp; This presents some issues regarding standardized coefficients and non-full rank parameterization, but the standardized coefficients issue is probably the harder to solve.&amp;nbsp; You may have to use GLMMOD to get the design matrix to feed into PROC REG.&amp;nbsp; That should solve both problems, I think.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
    <pubDate>Wed, 13 May 2020 20:01:20 GMT</pubDate>
    <dc:creator>SteveDenham</dc:creator>
    <dc:date>2020-05-13T20:01:20Z</dc:date>
    <item>
      <title>How do I perform a mediation analysis using multiple mediators and covariates</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-perform-a-mediation-analysis-using-multiple-mediators/m-p/647430#M31073</link>
      <description>&lt;P&gt;Hi community&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm currently working on research in self-harming behaviour. I have a large longitudinal dataset, and I am investigating the effect of hyperactivity difficulties in the early childhood on the risk of developing self-harming behavior as adolescent. I now want to investigate which possible mediating effects there might be between the two. So I have the following model:&lt;/P&gt;&lt;P&gt;Y = selfharm (binary)&lt;FONT face="arial, sans-serif"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;DIV&gt;&lt;FONT face="arial, sans-serif"&gt;treatment=hyperactivity in&amp;nbsp;early childhood (scale on 0-20)&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial, sans-serif"&gt;covariates: female (binary), divorced&lt;SPAN&gt;(binary)&lt;/SPAN&gt;, smoking&lt;SPAN&gt;(binary)&lt;/SPAN&gt;,&amp;nbsp;peer_dif&amp;nbsp;(scale on 0-10) and mater_menta (continous)&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial, sans-serif"&gt;I then have several mediators such as psychiatric&amp;nbsp;disorders, SDQ measures, addiction etc. which I want to test at the same time.&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial, sans-serif"&gt;But 'proc causalmed' can only handle one mediator. I then looked at 'Example 2' in this&amp;nbsp;link: &lt;A href="https://support.sas.com/kb/59/081.html" target="_blank" rel="noopener"&gt;https://support.sas.com/kb/59/081.html&lt;/A&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial, sans-serif"&gt;but as far as I can see, this example is without covariates.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial, sans-serif"&gt;So my question is, if there is a way I can do a mediation analysis with multiple mediators and covariates?&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial, sans-serif"&gt;I'm using SAS Studio..&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial, sans-serif"&gt;I have thought of first running a logistic regression, controlling self-harm for the covariates, but not hyperactivity, and then save the residual and use the residuals as my Y. But I'm not sure if that would make any sense. &amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial, sans-serif"&gt;Thank you for your time,&lt;/FONT&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 13 May 2020 11:54:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-perform-a-mediation-analysis-using-multiple-mediators/m-p/647430#M31073</guid>
      <dc:creator>Therese2</dc:creator>
      <dc:date>2020-05-13T11:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I perform a mediation analysis using multiple mediators and covariates</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-perform-a-mediation-analysis-using-multiple-mediators/m-p/647441#M31076</link>
      <description>&lt;P&gt;Did you look at Example 2 in the Usage Note&amp;nbsp;&lt;A href="https://support.sas.com/kb/59/081.html" target="_self"&gt;https://support.sas.com/kb/59/081.html&lt;/A&gt;&amp;nbsp; ?&amp;nbsp; That looks like a method is provided for both continuous and categorical effects (whether direct or mediators).&amp;nbsp; Unfortunately (at least for me), all of the code is done using proc logistic - proc means - proc reg.&amp;nbsp; To address your research question, you may need even more blocks of these procs to get something that then has to be combined in a DATA step to calculate all needed entities.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps the References and Resources links at the bottom would provide more illumination than what I came up with.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 12:23:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-perform-a-mediation-analysis-using-multiple-mediators/m-p/647441#M31076</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-05-13T12:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I perform a mediation analysis using multiple mediators and covariates</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-perform-a-mediation-analysis-using-multiple-mediators/m-p/647591#M31078</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15363"&gt;@SteveDenham&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;Yes, I've tried the example from the link. Unfortunately, the example does not use covariates, and I can't seem to figure out how or where to fit them into the datasteps in the code provided. I have considered to first run a Proc Logistic with only the covariates and then use the residuals as the outcome variable in the mediation analysis. Do you think that might be the way to do it?&lt;/P&gt;&lt;P&gt;Will take a closer look at the references...&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 19:39:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-perform-a-mediation-analysis-using-multiple-mediators/m-p/647591#M31078</guid>
      <dc:creator>Therese2</dc:creator>
      <dc:date>2020-05-13T19:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I perform a mediation analysis using multiple mediators and covariates</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-perform-a-mediation-analysis-using-multiple-mediators/m-p/647600#M31079</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/328706"&gt;@Therese2&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I probably don't know the vocabulary of your field well enough.&amp;nbsp; When you say "covariate" do you mean a categorical variable of some sort? The reason I ask is that Example 2 has SES as a continuous predictor in PROC LOGISTIC.&amp;nbsp; If you had a categorical variable, you could enter it in the MODEL statement and in a CLASS statement. The only drawback I see right off the top is that when a continuous mediator is modeled, the example uses PROC REG, which unfortunately does not support the CLASS statement.&amp;nbsp; You would probably have to substitute PROC GLM to include the categorical covariate.&amp;nbsp; This presents some issues regarding standardized coefficients and non-full rank parameterization, but the standardized coefficients issue is probably the harder to solve.&amp;nbsp; You may have to use GLMMOD to get the design matrix to feed into PROC REG.&amp;nbsp; That should solve both problems, I think.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 20:01:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-perform-a-mediation-analysis-using-multiple-mediators/m-p/647600#M31079</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-05-13T20:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I perform a mediation analysis using multiple mediators and covariates</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-perform-a-mediation-analysis-using-multiple-mediators/m-p/647603#M31080</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15363"&gt;@SteveDenham&lt;/a&gt;&amp;nbsp;sorry, covariates as in control variables..&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 20:14:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-perform-a-mediation-analysis-using-multiple-mediators/m-p/647603#M31080</guid>
      <dc:creator>Therese2</dc:creator>
      <dc:date>2020-05-13T20:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do I perform a mediation analysis using multiple mediators and covariates</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-perform-a-mediation-analysis-using-multiple-mediators/m-p/647759#M31083</link>
      <description>&lt;P&gt;Control variable = constant during the period of observation (at least that's how I think of it).&amp;nbsp; But that could be either categorical (biological sex) or continuous (weight at study enrollment).&amp;nbsp; Consequently, they could be either, which is the source of your original question I think. An overnight think on this leads me to believe the multi-step calculation presented in Example 2, using PROG LOGISTIC, PROC REG and a DATA step could be implemented.&amp;nbsp; The example uses a binary categorical mediator.&amp;nbsp; I assume the problem is that you have categorical variables with more than two levels. While adding a CLASS statement to PROC LOGISTIC seems the most straight forward to me, you could augment the data set with indicator (0/1) variables that define the levels of the categorical variables.&amp;nbsp; For a categorical variable with N levels, there would be N-1 indicator variables.&amp;nbsp; You would then include all of these indicator variables in the MODEL statement. Then you get the variance of the logits and go from there.&amp;nbsp; I think using the CLASS statement would be easier.&amp;nbsp; The key is going to be what the X*beta dataset looks like.&amp;nbsp; I assume that there will be one logit for each record, and there won't be any complications.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 11:31:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-perform-a-mediation-analysis-using-multiple-mediators/m-p/647759#M31083</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-05-14T11:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do I perform a mediation analysis using multiple mediators and covariates</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-perform-a-mediation-analysis-using-multiple-mediators/m-p/647762#M31084</link>
      <description>&lt;P&gt;Proc CAUSALMED will allow you to add multiple variables to the COVAR statement and thus you can have multiple covariates.&amp;nbsp; But it will only allow a single mediator (i.e. one MEDIATOR statement) with a single predictor.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Process Macro might be an option for you as it allows multiple mediators.&amp;nbsp; It can be downloaded with documentation here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://processmacro.org/download.html" target="_blank"&gt;http://processmacro.org/download.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 11:51:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-perform-a-mediation-analysis-using-multiple-mediators/m-p/647762#M31084</guid>
      <dc:creator>SAS_Rob</dc:creator>
      <dc:date>2020-05-14T11:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I perform a mediation analysis using multiple mediators and covariates</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-perform-a-mediation-analysis-using-multiple-mediators/m-p/647768#M31085</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/155173"&gt;@SAS_Rob&lt;/a&gt;&amp;nbsp;: I went to the PROCESS.ORG website, and, at least according to the FAQ, It should be able to address the &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/328706"&gt;@Therese2&lt;/a&gt;&amp;nbsp;'s issues. There is one huge drawback - the documentation for the program is not online, and is only available in the author's hardcopy book.&amp;nbsp; I suppose that if the issue is important enough, then spending 46USD shouldn't be a show-stopper.&lt;/P&gt;
&lt;P&gt;The fact that PROCESS,ORG uses PROC IML may be something that&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/328706"&gt;@Therese2&lt;/a&gt;&amp;nbsp;would have to address with the site administrator where they are located.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 12:22:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-perform-a-mediation-analysis-using-multiple-mediators/m-p/647768#M31085</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-05-14T12:22:33Z</dc:date>
    </item>
  </channel>
</rss>

