<?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 How to repeat the stratified analysis in macro by the group variable? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-repeat-the-stratified-analysis-in-macro-by-the-group/m-p/565272#M158684</link>
    <description>&lt;P&gt;Dear SAS experts :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to conduct a stratified analysis by age groups with 4 levels and use resulting ALL_MODEL data for a plotting purpose at the end. However, I get an error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set WORK.MODEL0_AGE1 may be incomplete. When this step was stopped there were&lt;BR /&gt;0 observations and 1 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think the way I'm trying to loop %DO N=1 %TO 4 is wrong.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestions to correct the code below? Thanks for your time in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%SYMDEL;
%macro models (PAR_MID,duration,AGEGRP);
%DO N=1 %TO 4;
ODS OUTPUT ParameterEstimates=&amp;amp;PAR_MID; 
PROC PHREG DATA = HAVE;
CLASS STAGE(REF='1')/PARAM=REF; 
MODEL duration*EXIT(0) = STAGE/RL EVENTCODE=1;
WHERE AGEGRP=&amp;amp;N;&lt;BR /&gt;%END;
RUN;
%LET MODEL=&amp;amp;PAR_MID;
DATA &amp;amp;PAR_MID; SET &amp;amp;PAR_MID;
LENGTH MODEL $15.; 
MODEL="&amp;amp;PAR_MID";
RUN;
%MEND MODELS;
%MODELS(MODEL0_AGE1,dur_MODEL01);
%MODELS(MODEL0_AGE2,dur_MODEL02);
%MODELS(MODEL0_AGE3,dur_MODEL03);
%MODELS(MODEL0_AGE4,dur_MODEL04);

%MODELS(MODEL5_AGE1,dur_MODEL5_1);
%MODELS(MODEL5_AGE2,dur_MODEL5_2);
%MODELS(MODEL5_AGE3,dur_MODEL5_3);
%MODELS(MODEL5_AGE4,dur_MODEL5_4);

%MODELS(MODEL25_AGE1,dur_MODEL25_1);
%MODELS(MODEL25_AGE2,dur_MODEL25_2);
%MODELS(MODEL25_AGE3,dur_MODEL25_3);
%MODELS(MODEL25_AGE4,dur_MODEL25_4);

%MODELS(MODEL50_AGE1,dur_MODEL50_1);
%MODELS(MODEL50_AGE2,dur_MODEL50_2);
%MODELS(MODEL50_AGE3,dur_MODEL50_3);
%MODELS(MODEL50_AGE4,dur_MODEL50_4);

%MODELS(MODEL75_AGE1,dur_MODEL75_1);
%MODELS(MODEL75_AGE2,dur_MODEL75_2);
%MODELS(MODEL75_AGE3,dur_MODEL75_3);
%MODELS(MODEL75_AGE4,dur_MODEL75_4);

%MODELS(MODEL100_AGE1,dur_MODEL100_1);
%MODELS(MODEL100_AGE2,dur_MODEL100_2);
%MODELS(MODEL100_AGE3,dur_MODEL100_3);
%MODELS(MODEL100_AGE4,dur_MODEL100_4);

DATA ALL_MODEL; SET MODEL:;
KEEP Estimate HRLowerCL HRUpperCL HazardRatio Label MODEL PERCENT;
PERCENT=SUBSTRN(MODEL,6,7);
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Jun 2019 15:22:49 GMT</pubDate>
    <dc:creator>Cruise</dc:creator>
    <dc:date>2019-06-11T15:22:49Z</dc:date>
    <item>
      <title>How to repeat the stratified analysis in macro by the group variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-repeat-the-stratified-analysis-in-macro-by-the-group/m-p/565272#M158684</link>
      <description>&lt;P&gt;Dear SAS experts :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to conduct a stratified analysis by age groups with 4 levels and use resulting ALL_MODEL data for a plotting purpose at the end. However, I get an error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set WORK.MODEL0_AGE1 may be incomplete. When this step was stopped there were&lt;BR /&gt;0 observations and 1 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think the way I'm trying to loop %DO N=1 %TO 4 is wrong.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestions to correct the code below? Thanks for your time in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%SYMDEL;
%macro models (PAR_MID,duration,AGEGRP);
%DO N=1 %TO 4;
ODS OUTPUT ParameterEstimates=&amp;amp;PAR_MID; 
PROC PHREG DATA = HAVE;
CLASS STAGE(REF='1')/PARAM=REF; 
MODEL duration*EXIT(0) = STAGE/RL EVENTCODE=1;
WHERE AGEGRP=&amp;amp;N;&lt;BR /&gt;%END;
RUN;
%LET MODEL=&amp;amp;PAR_MID;
DATA &amp;amp;PAR_MID; SET &amp;amp;PAR_MID;
LENGTH MODEL $15.; 
MODEL="&amp;amp;PAR_MID";
RUN;
%MEND MODELS;
%MODELS(MODEL0_AGE1,dur_MODEL01);
%MODELS(MODEL0_AGE2,dur_MODEL02);
%MODELS(MODEL0_AGE3,dur_MODEL03);
%MODELS(MODEL0_AGE4,dur_MODEL04);

%MODELS(MODEL5_AGE1,dur_MODEL5_1);
%MODELS(MODEL5_AGE2,dur_MODEL5_2);
%MODELS(MODEL5_AGE3,dur_MODEL5_3);
%MODELS(MODEL5_AGE4,dur_MODEL5_4);

%MODELS(MODEL25_AGE1,dur_MODEL25_1);
%MODELS(MODEL25_AGE2,dur_MODEL25_2);
%MODELS(MODEL25_AGE3,dur_MODEL25_3);
%MODELS(MODEL25_AGE4,dur_MODEL25_4);

%MODELS(MODEL50_AGE1,dur_MODEL50_1);
%MODELS(MODEL50_AGE2,dur_MODEL50_2);
%MODELS(MODEL50_AGE3,dur_MODEL50_3);
%MODELS(MODEL50_AGE4,dur_MODEL50_4);

%MODELS(MODEL75_AGE1,dur_MODEL75_1);
%MODELS(MODEL75_AGE2,dur_MODEL75_2);
%MODELS(MODEL75_AGE3,dur_MODEL75_3);
%MODELS(MODEL75_AGE4,dur_MODEL75_4);

%MODELS(MODEL100_AGE1,dur_MODEL100_1);
%MODELS(MODEL100_AGE2,dur_MODEL100_2);
%MODELS(MODEL100_AGE3,dur_MODEL100_3);
%MODELS(MODEL100_AGE4,dur_MODEL100_4);

DATA ALL_MODEL; SET MODEL:;
KEEP Estimate HRLowerCL HRUpperCL HazardRatio Label MODEL PERCENT;
PERCENT=SUBSTRN(MODEL,6,7);
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 15:22:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-repeat-the-stratified-analysis-in-macro-by-the-group/m-p/565272#M158684</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2019-06-11T15:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to repeat the stratified analysis in macro by the group variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-repeat-the-stratified-analysis-in-macro-by-the-group/m-p/565328#M158704</link>
      <description>&lt;P&gt;Is there some particular reason you don't want to use BY group processing to produce output for each age group?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 17:16:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-repeat-the-stratified-analysis-in-macro-by-the-group/m-p/565328#M158704</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-11T17:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to repeat the stratified analysis in macro by the group variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-repeat-the-stratified-analysis-in-macro-by-the-group/m-p/565341#M158712</link>
      <description>that's great idea. I should use BY.</description>
      <pubDate>Tue, 11 Jun 2019 18:00:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-repeat-the-stratified-analysis-in-macro-by-the-group/m-p/565341#M158712</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2019-06-11T18:00:57Z</dc:date>
    </item>
  </channel>
</rss>

