<?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: Poisson Regression for Complex Surveys: Problem with Code in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Poisson-Regression-for-Complex-Surveys-Problem-with-Code/m-p/849474#M335834</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437607"&gt;@lsr0820&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran both versions of the code -- version 1: using section 3a, version 2: using section 3b -- successfully &lt;EM&gt;in two separate SAS sessions&lt;/EM&gt; to avoid any conflicts between the two versions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your log indicates that the PROC APPEND steps contained in macro &lt;FONT face="courier new,courier"&gt;jkloop&lt;/FONT&gt;&amp;nbsp;&lt;EM&gt;duplicated&lt;/EM&gt; some of the datasets, in particular dataset JKDF (which thus has got 7600 instead of 3800 observations), because they appended new data to datasets existing from a previous run or from a section of the code that should not have been run before (in the same SAS session). This must have caused the sort issues (like duplicating 1, 2, 3 to 1, 2, 3,&amp;nbsp;&lt;STRONG&gt;1&lt;/STRONG&gt;, 2, 3). So you do &lt;EM&gt;not&lt;/EM&gt; need to insert your own PROC SORT steps. Just run the original code &lt;U&gt;&lt;EM&gt;either&lt;/EM&gt;&lt;/U&gt; using section 3a &lt;U&gt;&lt;EM&gt;or&lt;/EM&gt;&lt;/U&gt; section 3b in a new SAS session.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's one (actually irrelevant) warning in the log due to an inconsistency between macro &lt;FONT face="courier new,courier"&gt;jkloop&lt;/FONT&gt;&amp;nbsp;and the code before. To avoid the warning, you can delete the data step&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  data FullSample;
    set FullSample;
    rename estimate=estimate0;
  run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;close to the end of macro &lt;FONT face="courier new,courier"&gt;jkloop&lt;/FONT&gt;. It is redundant because of the RENAME= dataset option to the same effect which was applied to dataset &lt;FONT face="courier new,courier"&gt;FullSample&lt;/FONT&gt; when it was created by an ODS OUTPUT statement earlier in the code.&lt;/P&gt;</description>
    <pubDate>Tue, 13 Dec 2022 18:13:01 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2022-12-13T18:13:01Z</dc:date>
    <item>
      <title>Poisson Regression for Complex Surveys: Problem with Code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Poisson-Regression-for-Complex-Surveys-Problem-with-Code/m-p/849463#M335827</link>
      <description>&lt;P&gt;I am attempting to implement the following code:&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.sas.com/rnd/app/stat/examples/SurveyPoisson/surveypoisson.htm" target="_blank"&gt;https://support.sas.com/rnd/app/stat/examples/SurveyPoisson/surveypoisson.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I copied the code from the SAS program tab here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.sas.com/rnd/app/stat/examples/SurveyPoisson/sas.html" target="_blank"&gt;https://support.sas.com/rnd/app/stat/examples/SurveyPoisson/sas.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I am encountering errors at section 4 of the code, after running the two macros. (See attached log, with errors highlighted in yellow.) Note also the code sections highlighted in aqua; I added these PROC SORT statements to address errors with the 'by' statements encountered in subsequent syntax.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attempted the solution noted in the following post (running the 3a and 3b macros separately):&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Statistical-Procedures/Poisson-Regressions-for-Complex-Surveys/td-p/396602" target="_blank"&gt;https://communities.sas.com/t5/Statistical-Procedures/Poisson-Regressions-for-Complex-Surveys/td-p/396602&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attempted to run sections 3a and 3b, separately, in sequence; and also to run through section 3a, then comment out this section, and run again from section 1 through section 3b. However, I continue to encounter the error. Any assistance would be appreciated. Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 17:01:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Poisson-Regression-for-Complex-Surveys-Problem-with-Code/m-p/849463#M335827</guid>
      <dc:creator>lsr0820</dc:creator>
      <dc:date>2022-12-13T17:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: Poisson Regression for Complex Surveys: Problem with Code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Poisson-Regression-for-Complex-Surveys-Problem-with-Code/m-p/849474#M335834</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437607"&gt;@lsr0820&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran both versions of the code -- version 1: using section 3a, version 2: using section 3b -- successfully &lt;EM&gt;in two separate SAS sessions&lt;/EM&gt; to avoid any conflicts between the two versions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your log indicates that the PROC APPEND steps contained in macro &lt;FONT face="courier new,courier"&gt;jkloop&lt;/FONT&gt;&amp;nbsp;&lt;EM&gt;duplicated&lt;/EM&gt; some of the datasets, in particular dataset JKDF (which thus has got 7600 instead of 3800 observations), because they appended new data to datasets existing from a previous run or from a section of the code that should not have been run before (in the same SAS session). This must have caused the sort issues (like duplicating 1, 2, 3 to 1, 2, 3,&amp;nbsp;&lt;STRONG&gt;1&lt;/STRONG&gt;, 2, 3). So you do &lt;EM&gt;not&lt;/EM&gt; need to insert your own PROC SORT steps. Just run the original code &lt;U&gt;&lt;EM&gt;either&lt;/EM&gt;&lt;/U&gt; using section 3a &lt;U&gt;&lt;EM&gt;or&lt;/EM&gt;&lt;/U&gt; section 3b in a new SAS session.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's one (actually irrelevant) warning in the log due to an inconsistency between macro &lt;FONT face="courier new,courier"&gt;jkloop&lt;/FONT&gt;&amp;nbsp;and the code before. To avoid the warning, you can delete the data step&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  data FullSample;
    set FullSample;
    rename estimate=estimate0;
  run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;close to the end of macro &lt;FONT face="courier new,courier"&gt;jkloop&lt;/FONT&gt;. It is redundant because of the RENAME= dataset option to the same effect which was applied to dataset &lt;FONT face="courier new,courier"&gt;FullSample&lt;/FONT&gt; when it was created by an ODS OUTPUT statement earlier in the code.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 18:13:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Poisson-Regression-for-Complex-Surveys-Problem-with-Code/m-p/849474#M335834</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-12-13T18:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: Poisson Regression for Complex Surveys: Problem with Code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Poisson-Regression-for-Complex-Surveys-Problem-with-Code/m-p/849479#M335836</link>
      <description>&lt;P&gt;Running the sections in two separate SAS sessions solved the issue! Thanks very much for the help.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 18:45:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Poisson-Regression-for-Complex-Surveys-Problem-with-Code/m-p/849479#M335836</guid>
      <dc:creator>lsr0820</dc:creator>
      <dc:date>2022-12-13T18:45:26Z</dc:date>
    </item>
  </channel>
</rss>

