<?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 to run multiple linear regression by using Macro in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-run-multiple-linear-regression-by-using-Macro/m-p/822832#M35036</link>
    <description>&lt;P&gt;Ok, PLS can do everything you ask, and does it better than linear regressions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your problem has to have 900 regressions, then I will leave the problem to others to help you create such a macro.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Jul 2022 13:34:57 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-07-12T13:34:57Z</dc:date>
    <item>
      <title>How to run multiple linear regression by using Macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-run-multiple-linear-regression-by-using-Macro/m-p/822698#M35024</link>
      <description>&lt;P&gt;I have several outcomes of interest and exposures of interest and I want to run many MLR to see the relationships, but this is very tedious, so I want to know how can I use macro to simplify the process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code:&lt;/P&gt;&lt;P class=""&gt;&lt;FONT color="#3366FF"&gt;proc glm&lt;/FONT&gt; &lt;FONT color="#3366FF"&gt;data&lt;/FONT&gt; = xxx;&lt;/P&gt;&lt;P class=""&gt;&lt;FONT color="#3366FF"&gt;model&lt;/FONT&gt; A B C =smoke nutrient smoke*nutrient&amp;nbsp; height Age sex race BMI education;&lt;/P&gt;&lt;P class=""&gt;&lt;FONT color="#3366FF"&gt;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;A, B, and C are my outcomes of interest.&lt;/P&gt;&lt;P class=""&gt;I want to change the "nutrient" in each MLR, e.g. fat, protein, carbs...&lt;/P&gt;&lt;P class=""&gt;So I want to run the model of A and fat, B and fat, C and fat, A and protein, B and protein......&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 22:04:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-run-multiple-linear-regression-by-using-Macro/m-p/822698#M35024</guid>
      <dc:creator>greenie</dc:creator>
      <dc:date>2022-07-11T22:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to run multiple linear regression by using Macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-run-multiple-linear-regression-by-using-Macro/m-p/822699#M35025</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;So I want to run the model of A and fat, B and fat, C and fat, A and protein, B and protein......&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please explain further. This seems to contradict your MODEL statement in PROC GLM which has models with 9 or 10 factors.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 22:09:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-run-multiple-linear-regression-by-using-Macro/m-p/822699#M35025</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-07-11T22:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to run multiple linear regression by using Macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-run-multiple-linear-regression-by-using-Macro/m-p/822717#M35026</link>
      <description>&lt;P&gt;Hi thank you for reply.&lt;/P&gt;&lt;P&gt;I have 3 outcomes, and 300 of nutrients and smoke as exposures. Others in the right side of the "=" are covariates (confounders). Each time I can only run:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;model (1 outcome) = smoke (1 nutrient)&amp;nbsp; smoke*(1 nutrient)&amp;nbsp; height Age sex race BMI education;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So basically I need to loop all the nutrients, otherwise I need to run the model 3*300=900 times.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 00:23:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-run-multiple-linear-regression-by-using-Macro/m-p/822717#M35026</guid>
      <dc:creator>greenie</dc:creator>
      <dc:date>2022-07-12T00:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to run multiple linear regression by using Macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-run-multiple-linear-regression-by-using-Macro/m-p/822801#M35033</link>
      <description>&lt;P&gt;First, after you run these 900 models, then what will you do with all that information?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me suggest a complete change of direction. My suggestion is to stop using linear regression and use Partial Least Squares regression (PROC PLS in SAS). This was specifically designed for cases where you have lots of variables, that are correlated with one another, and multiple response variables. You fit one model, and then PLS tells you which variables are the important predictors, which variables are correlated with one another, and even which of your y-variables are correlated with other y-variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One PLS model, which provides a lot of information, or 900 OLS models. I go with PLS almost every time. And therefore, writing a macro to do what you want is unnecessary.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 11:54:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-run-multiple-linear-regression-by-using-Macro/m-p/822801#M35033</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-07-12T11:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to run multiple linear regression by using Macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-run-multiple-linear-regression-by-using-Macro/m-p/822831#M35035</link>
      <description>I want to know which nutrients that interact with smoke can impact my exposure (3 different aspects of lung function). So I want to check the interaction items' p-value. So 900 models I need to check 900 interaction items' p-value.</description>
      <pubDate>Tue, 12 Jul 2022 13:26:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-run-multiple-linear-regression-by-using-Macro/m-p/822831#M35035</guid>
      <dc:creator>greenie</dc:creator>
      <dc:date>2022-07-12T13:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to run multiple linear regression by using Macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-run-multiple-linear-regression-by-using-Macro/m-p/822832#M35036</link>
      <description>&lt;P&gt;Ok, PLS can do everything you ask, and does it better than linear regressions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your problem has to have 900 regressions, then I will leave the problem to others to help you create such a macro.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 13:34:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-run-multiple-linear-regression-by-using-Macro/m-p/822832#M35036</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-07-12T13:34:57Z</dc:date>
    </item>
  </channel>
</rss>

