<?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: re-allocate a category to other categories in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/re-allocate-a-category-to-other-categories/m-p/852925#M337136</link>
    <description>&lt;P&gt;You can use the RAND functions with the &lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/lefunctionsref/p0fpeei0opypg8n1b06qe4r040lv.htm#p0rssof65ddoyyn1s3kfdap849lr" target="_self"&gt;'TABLE' option&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if age_2=9 then age_2=rand('table',0.0743,0.1491,0.1526,0.1981,0.2110,0.2060);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 09 Jan 2023 20:39:47 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2023-01-09T20:39:47Z</dc:date>
    <item>
      <title>re-allocate a category to other categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-allocate-a-category-to-other-categories/m-p/852899#M337126</link>
      <description>&lt;P&gt;I am trying to allocate a no-response category to other categories for a&amp;nbsp; age variable. The frequencies of age shown below&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Table 1. age_2&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;age_2&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD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/TD&gt;&lt;TD&gt;&lt;P&gt;416&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;20.60&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2001&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;99.11&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;9. no respond (NB)&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;18&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0.89&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2019&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;100.00&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I used following code to redistribute no-response to other 1 to 6 categories in the data step (result shown in Table 2). From the table (Table 1) above, one can see that there are more older people (45 years old+) in the data set. Is there a method I can use to distribute more cases of “NB” to the age group 4 to 6? &amp;nbsp;Or there is method that I can use to allocate the cases of NB to other categories (1-6) according the distribution of the age group (see Table 1)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data set1;&lt;/P&gt;&lt;P&gt;Set set1 &amp;nbsp;&lt;/P&gt;&lt;P&gt;call streaminit(&lt;STRONG&gt;0&lt;/STRONG&gt;);&lt;/P&gt;&lt;P&gt;if age_2=&lt;STRONG&gt;9&lt;/STRONG&gt; then age_2=ceil(ranuni(&lt;STRONG&gt;0&lt;/STRONG&gt;)*&lt;STRONG&gt;5+1&lt;/STRONG&gt;);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Table 2. age_2&lt;/STRONG&gt;&lt;/P&gt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;&lt;STRONG&gt;6.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;STRONG&gt;65 and up&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;417&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;20.65&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2019&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;100.00&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 18:30:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-allocate-a-category-to-other-categories/m-p/852899#M337126</guid>
      <dc:creator>ting1</dc:creator>
      <dc:date>2023-01-09T18:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: re-allocate a category to other categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-allocate-a-category-to-other-categories/m-p/852925#M337136</link>
      <description>&lt;P&gt;You can use the RAND functions with the &lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/lefunctionsref/p0fpeei0opypg8n1b06qe4r040lv.htm#p0rssof65ddoyyn1s3kfdap849lr" target="_self"&gt;'TABLE' option&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if age_2=9 then age_2=rand('table',0.0743,0.1491,0.1526,0.1981,0.2110,0.2060);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Jan 2023 20:39:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-allocate-a-category-to-other-categories/m-p/852925#M337136</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-01-09T20:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: re-allocate a category to other categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-allocate-a-category-to-other-categories/m-p/852926#M337137</link>
      <description>Run the table without the NB category and get your percentages. Multiply those percentages by the total number INCLUDING the NB to get your new adjusted numbers proportionally. &lt;BR /&gt;&lt;BR /&gt;Or do you want to randomly adjust the categories? Random rounding is a bit harder...&lt;BR /&gt;</description>
      <pubDate>Mon, 09 Jan 2023 20:39:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-allocate-a-category-to-other-categories/m-p/852926#M337137</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-01-09T20:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: re-allocate a category to other categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-allocate-a-category-to-other-categories/m-p/852931#M337140</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Run the table without the NB category and get your percentages. &lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Excellent point!&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 20:49:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-allocate-a-category-to-other-categories/m-p/852931#M337140</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-01-09T20:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: re-allocate a category to other categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-allocate-a-category-to-other-categories/m-p/852934#M337143</link>
      <description>Thanks for your help!</description>
      <pubDate>Mon, 09 Jan 2023 20:59:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-allocate-a-category-to-other-categories/m-p/852934#M337143</guid>
      <dc:creator>ting1</dc:creator>
      <dc:date>2023-01-09T20:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: re-allocate a category to other categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-allocate-a-category-to-other-categories/m-p/852935#M337144</link>
      <description>Thanks for the solution.</description>
      <pubDate>Mon, 09 Jan 2023 20:59:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-allocate-a-category-to-other-categories/m-p/852935#M337144</guid>
      <dc:creator>ting1</dc:creator>
      <dc:date>2023-01-09T20:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: re-allocate a category to other categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-allocate-a-category-to-other-categories/m-p/852943#M337150</link>
      <description>&lt;P&gt;Make sure to set the streaminit variable with a constant, otherwise everytime you run the code you may get a slightly different answer.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 21:32:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-allocate-a-category-to-other-categories/m-p/852943#M337150</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-01-09T21:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: re-allocate a category to other categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-allocate-a-category-to-other-categories/m-p/853049#M337188</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/80132"&gt;@ting1&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You've already got valuable suggestions from &lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892" target="_blank" rel="noopener"&gt;PaigeMiller&lt;/A&gt;&amp;nbsp;and &lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879" target="_blank" rel="noopener"&gt;Reeza&lt;/A&gt;. Here's another approach:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
call streaminit(27182818);
set have;
if age_2=9 then do until(age_2 ne 9);
  p=rand('integer',n);
  set have(keep=age_2) nobs=n point=p;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/p0fpeei0opypg8n1b06qe4r040lv.htm#p0i0papjdn73pzn1kxrjoyygmdfb" target="_blank" rel="noopener"&gt;RAND 'INTEGER' function&lt;/A&gt; with the number &lt;FONT face="courier new,courier"&gt;n&lt;/FONT&gt; of observations in your original dataset (I called it "HAVE") as the parameter returns a random observation number (uniformly distributed on {1, 2, ..., &lt;FONT face="courier new,courier"&gt;n&lt;/FONT&gt;}). The AGE_2 value of the corresponding observation is then read by the second SET statement and overwrites the original value AGE_2=9. If the random observation happened to have AGE_2=9 as well (probability only 0.0089 according to your frequency table), the DO UNTIL loop starts another random draw and so on, until an admissible AGE_2 value is found. Thus, the probability distribution of the randomly selected AGE_2 values matches the distribution of AGE_2 values in &lt;FONT face="courier new,courier"&gt;have(where=(age_2 ne 9))&lt;/FONT&gt;, as desired. (Edit: More precisely, it's the multinomial distribution Mult(&lt;EM&gt;m&lt;/EM&gt;, &lt;EM&gt;p&lt;SUB&gt;1&lt;/SUB&gt;&lt;/EM&gt;, ..., &lt;EM&gt;p&lt;SUB&gt;6&lt;/SUB&gt;&lt;/EM&gt;) with parameters &lt;EM&gt;m&lt;/EM&gt;=18 and &lt;EM&gt;p&lt;SUB&gt;i&lt;/SUB&gt;&lt;/EM&gt; the relative frequency of AGE_2 category &lt;EM&gt;i&lt;/EM&gt; in that WHERE-restricted HAVE dataset, &lt;EM&gt;i&lt;/EM&gt;=1, ..., 6.)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that your code&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;Data set1;&lt;/P&gt;
&lt;P&gt;Set set1 &amp;nbsp;&lt;/P&gt;
&lt;P&gt;call streaminit(&lt;STRONG&gt;0&lt;/STRONG&gt;);&lt;/P&gt;
&lt;P&gt;if age_2=&lt;STRONG&gt;9&lt;/STRONG&gt; then age_2=ceil(ranuni(&lt;STRONG&gt;0&lt;/STRONG&gt;)*&lt;STRONG&gt;5+1&lt;/STRONG&gt;);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;is not quite correct:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The pseudorandom values are uniformly distributed on {&lt;STRONG&gt;2&lt;/STRONG&gt;, 3, 4, 5, 6}, thus neglecting the first age category. Since &lt;FONT face="courier new,courier"&gt;ranuni(0)&amp;gt;1E-10&lt;/FONT&gt;, the CEIL function would never return the value 1.&lt;/LI&gt;
&lt;LI&gt;The STREAMINIT call routine has no impact on the values created by the (&lt;A href="https://blogs.sas.com/content/iml/2013/07/10/stop-using-ranuni.html" target="_blank" rel="noopener"&gt;deprecated!&lt;/A&gt;) RANUNI function. So, better use the RAND function, whose values depend on the initialization by CALL STREAMINIT.&lt;/LI&gt;
&lt;LI&gt;Missing semicolon after the SET statement (particularly risky because you're overwriting dataset SET1).&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 10 Jan 2023 14:59:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-allocate-a-category-to-other-categories/m-p/853049#M337188</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2023-01-10T14:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: re-allocate a category to other categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-allocate-a-category-to-other-categories/m-p/853696#M337416</link>
      <description>Thanks!</description>
      <pubDate>Fri, 13 Jan 2023 12:51:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-allocate-a-category-to-other-categories/m-p/853696#M337416</guid>
      <dc:creator>ting1</dc:creator>
      <dc:date>2023-01-13T12:51:23Z</dc:date>
    </item>
  </channel>
</rss>

