<?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 Collapsing levels of a categorical variable. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Collapsing-levels-of-a-categorical-variable/m-p/667690#M200000</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am trying to collapse the levels of my categorical variable Readto_1617 from 4 to 3 levels.&lt;/P&gt;&lt;P&gt;These are the current levels. I must say, my current level when it comes to SAS is a beginner&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;value read /*readto_1617*/&lt;BR /&gt;1 = "0 days"&lt;BR /&gt;2 = "1-3 days"&lt;BR /&gt;3 = "4-6 days"&lt;BR /&gt;4 = "Every day"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want&amp;nbsp; to combine 1= "0 days" and 2="1-3 days" such that my levels will now be&lt;/P&gt;&lt;P&gt;1 = "0 -3 days"&lt;BR /&gt;2 =&amp;nbsp;&amp;nbsp;"4-6 days"&lt;BR /&gt;3 = "Every day"&lt;/P&gt;&lt;P&gt;Below was how it was formatted&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;proc format;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;value read /*readto_1617*/ &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;1 = "0 days" &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;2 = "1-3 days" &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;3 = "4-6 days" &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;4 = "Every day";&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;How do I change it to 3 levels?&amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;Thanks for the anticipated help&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Jul 2020 12:48:14 GMT</pubDate>
    <dc:creator>microdire27</dc:creator>
    <dc:date>2020-07-08T12:48:14Z</dc:date>
    <item>
      <title>Collapsing levels of a categorical variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Collapsing-levels-of-a-categorical-variable/m-p/667690#M200000</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am trying to collapse the levels of my categorical variable Readto_1617 from 4 to 3 levels.&lt;/P&gt;&lt;P&gt;These are the current levels. I must say, my current level when it comes to SAS is a beginner&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;value read /*readto_1617*/&lt;BR /&gt;1 = "0 days"&lt;BR /&gt;2 = "1-3 days"&lt;BR /&gt;3 = "4-6 days"&lt;BR /&gt;4 = "Every day"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want&amp;nbsp; to combine 1= "0 days" and 2="1-3 days" such that my levels will now be&lt;/P&gt;&lt;P&gt;1 = "0 -3 days"&lt;BR /&gt;2 =&amp;nbsp;&amp;nbsp;"4-6 days"&lt;BR /&gt;3 = "Every day"&lt;/P&gt;&lt;P&gt;Below was how it was formatted&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;proc format;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;value read /*readto_1617*/ &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;1 = "0 days" &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;2 = "1-3 days" &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;3 = "4-6 days" &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;4 = "Every day";&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;How do I change it to 3 levels?&amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;Thanks for the anticipated help&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2020 12:48:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Collapsing-levels-of-a-categorical-variable/m-p/667690#M200000</guid>
      <dc:creator>microdire27</dc:creator>
      <dc:date>2020-07-08T12:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Collapsing levels of a categorical variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Collapsing-levels-of-a-categorical-variable/m-p/667694#M200002</link>
      <description>&lt;P&gt;You talk about collapsing levels, which in this case has nothing to do with formats. It has to do with your data, which you need to show us (a portion of). We need to see the days.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2020 13:02:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Collapsing-levels-of-a-categorical-variable/m-p/667694#M200002</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-07-08T13:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Collapsing levels of a categorical variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Collapsing-levels-of-a-categorical-variable/m-p/667699#M200007</link>
      <description>It is a large data set of about 71000 observations and 771 variables. Besides I can't find where I can attach the data file to along with this message.</description>
      <pubDate>Wed, 08 Jul 2020 13:25:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Collapsing-levels-of-a-categorical-variable/m-p/667699#M200007</guid>
      <dc:creator>microdire27</dc:creator>
      <dc:date>2020-07-08T13:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: Collapsing levels of a categorical variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Collapsing-levels-of-a-categorical-variable/m-p/667700#M200008</link>
      <description>&lt;P&gt;I asked for a "portion of" your data, and the variable that contains days.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, perhaps you could just show us the (portion of) code that turns the days into 0, 1, 2, ... You can paste it right into your message by clicking on the "running man" icon and pasting it into the window that appears.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2020 13:28:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Collapsing-levels-of-a-categorical-variable/m-p/667700#M200008</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-07-08T13:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Collapsing levels of a categorical variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Collapsing-levels-of-a-categorical-variable/m-p/667702#M200010</link>
      <description>&lt;P&gt;Hi &lt;A class="trigger-hovercard" style="color: #007dc3;" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/335452" target="_blank"&gt;microdire27&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;Here is how you can change it to 3 levels:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
   value read 
      1,2 = "0 -3 days"
      3 = "4-6 days"
      4 = "Every day";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2020 13:30:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Collapsing-levels-of-a-categorical-variable/m-p/667702#M200010</guid>
      <dc:creator>LeonidBatkhan</dc:creator>
      <dc:date>2020-07-08T13:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Collapsing levels of a categorical variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Collapsing-levels-of-a-categorical-variable/m-p/667737#M200032</link>
      <description>&lt;P&gt;It works. Thank you so much.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2020 15:03:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Collapsing-levels-of-a-categorical-variable/m-p/667737#M200032</guid>
      <dc:creator>microdire27</dc:creator>
      <dc:date>2020-07-08T15:03:49Z</dc:date>
    </item>
  </channel>
</rss>

