<?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 Macro variable as a predictor in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-as-a-predictor/m-p/649198#M194604</link>
    <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to run multiple models in a macro using macro variable as a predictor. However, instead of 14 models I get one model with 14 predictors plus covariates. Here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let biomarker = TotalC nonHDLC RemnantC VLDLC ClinicalLDLC LDLC HDLC TotalTG VLDLTG LDLTG HDLTG TotalPL VLDLPL LDLPL;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro poisson ;&lt;BR /&gt;proc genmod data = met;&lt;BR /&gt;ods output ParameterEstimates=parm;&lt;BR /&gt;model comorbidity = &amp;amp;biomarker gestational_age birth_year child_sex/ alpha=0.0017 dist=poisson; run;&lt;BR /&gt;%mend poisson;&lt;/P&gt;&lt;P&gt;%poisson&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Polina_UH_0-1589978327466.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/39659i16FBF12BAB3C279E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Polina_UH_0-1589978327466.png" alt="Polina_UH_0-1589978327466.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;&lt;P&gt;I would really appreciate an advice how to modify my code to obtain 14 models with each of the biomarkers as a separate predictor plus covariates.&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 20 May 2020 12:39:09 GMT</pubDate>
    <dc:creator>Polina_UH</dc:creator>
    <dc:date>2020-05-20T12:39:09Z</dc:date>
    <item>
      <title>Macro variable as a predictor</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-as-a-predictor/m-p/649198#M194604</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to run multiple models in a macro using macro variable as a predictor. However, instead of 14 models I get one model with 14 predictors plus covariates. Here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let biomarker = TotalC nonHDLC RemnantC VLDLC ClinicalLDLC LDLC HDLC TotalTG VLDLTG LDLTG HDLTG TotalPL VLDLPL LDLPL;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro poisson ;&lt;BR /&gt;proc genmod data = met;&lt;BR /&gt;ods output ParameterEstimates=parm;&lt;BR /&gt;model comorbidity = &amp;amp;biomarker gestational_age birth_year child_sex/ alpha=0.0017 dist=poisson; run;&lt;BR /&gt;%mend poisson;&lt;/P&gt;&lt;P&gt;%poisson&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Polina_UH_0-1589978327466.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/39659i16FBF12BAB3C279E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Polina_UH_0-1589978327466.png" alt="Polina_UH_0-1589978327466.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;&lt;P&gt;I would really appreciate an advice how to modify my code to obtain 14 models with each of the biomarkers as a separate predictor plus covariates.&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 12:39:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-as-a-predictor/m-p/649198#M194604</guid>
      <dc:creator>Polina_UH</dc:creator>
      <dc:date>2020-05-20T12:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable as a predictor</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-as-a-predictor/m-p/649200#M194605</link>
      <description>&lt;P&gt;You need a macro %DO loop.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let biomarker = TotalC nonHDLC RemnantC VLDLC ClinicalLDLC LDLC HDLC TotalTG VLDLTG LDLTG HDLTG TotalPL VLDLPL LDLPL;

%macro poisson ;
     %do i=1 %to %sysfunc(countw(&amp;amp;biomarker));
        %let thisvar=%scan(&amp;amp;biomarker,&amp;amp;i,%str( ));
        proc genmod data = met;   
        ods output ParameterEstimates=parm&amp;amp;i;
        model comorbidity = &amp;amp;thisvar gestational_age birth_year child_sex/ alpha=0.0017 dist=poisson;
        run;
    %end;
%mend poisson;
%poisson&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 May 2020 12:46:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-as-a-predictor/m-p/649200#M194605</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-05-20T12:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable as a predictor</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-as-a-predictor/m-p/649201#M194606</link>
      <description>&lt;P&gt;Thank you so much, it worked!&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 12:52:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-as-a-predictor/m-p/649201#M194606</guid>
      <dc:creator>Polina_UH</dc:creator>
      <dc:date>2020-05-20T12:52:47Z</dc:date>
    </item>
  </channel>
</rss>

