<?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: How to categorize data when raw data is not 1,2,3 etc. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-categorize-data-when-raw-data-is-not-1-2-3-etc/m-p/679789#M205307</link>
    <description>101 - 199 is 99 so you're checking if your value is 99. &lt;BR /&gt;&lt;BR /&gt;I think you want:&lt;BR /&gt;&lt;BR /&gt;if alcday5 in (101:199) then alcohol = 3;&lt;BR /&gt;&lt;BR /&gt;OR&lt;BR /&gt;&lt;BR /&gt;if alcday5 &amp;gt;= 101 and alcday5 &amp;lt;=199 then alcohol = 3;&lt;BR /&gt;&lt;BR /&gt;Please post code as text not images in the future.</description>
    <pubDate>Thu, 27 Aug 2020 16:12:36 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-08-27T16:12:36Z</dc:date>
    <item>
      <title>How to categorize data when raw data is not 1,2,3 etc.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-categorize-data-when-raw-data-is-not-1-2-3-etc/m-p/679788#M205306</link>
      <description>&lt;P&gt;Hi, from raw data I have always found 1,2,3, likewise but in this particular reserch question in raw data 101-199, 201-299, 888! If I use the below code I get only raw data 888 results because this code only worked not the 101-199 or 201-299. How do I fix that?&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="This is the code I have used to categorize the raw data as 1,2,3" style="width: 737px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/48720iF5A0CBBC73A5A544/image-size/large?v=v2&amp;amp;px=999" role="button" title="code error.PNG" alt="This is the code I have used to categorize the raw data as 1,2,3" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;This is the code I have used to categorize the raw data as 1,2,3&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Result! Frequency missing" style="width: 436px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/48721i62473FDEC576F84A/image-size/large?v=v2&amp;amp;px=999" role="button" title="code error 2.PNG" alt="Result! Frequency missing" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Result! Frequency missing&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 16:08:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-categorize-data-when-raw-data-is-not-1-2-3-etc/m-p/679788#M205306</guid>
      <dc:creator>zahidhasandipu</dc:creator>
      <dc:date>2020-08-27T16:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to categorize data when raw data is not 1,2,3 etc.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-categorize-data-when-raw-data-is-not-1-2-3-etc/m-p/679789#M205307</link>
      <description>101 - 199 is 99 so you're checking if your value is 99. &lt;BR /&gt;&lt;BR /&gt;I think you want:&lt;BR /&gt;&lt;BR /&gt;if alcday5 in (101:199) then alcohol = 3;&lt;BR /&gt;&lt;BR /&gt;OR&lt;BR /&gt;&lt;BR /&gt;if alcday5 &amp;gt;= 101 and alcday5 &amp;lt;=199 then alcohol = 3;&lt;BR /&gt;&lt;BR /&gt;Please post code as text not images in the future.</description>
      <pubDate>Thu, 27 Aug 2020 16:12:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-categorize-data-when-raw-data-is-not-1-2-3-etc/m-p/679789#M205307</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-08-27T16:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to categorize data when raw data is not 1,2,3 etc.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-categorize-data-when-raw-data-is-not-1-2-3-etc/m-p/679792#M205308</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if alcday5 = 101-199&amp;nbsp;then&amp;nbsp;...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;one hundred one minus one hundred ninety nine is negative 98 (that's how the minus sign is interpreted in this code in SAS)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So this code is not doing what you want it to do, since alcday5 is never equal to –98&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You probably want this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if 101&amp;lt;=alcday5&amp;lt;=199 then ...&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Aug 2020 16:14:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-categorize-data-when-raw-data-is-not-1-2-3-etc/m-p/679792#M205308</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-08-27T16:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to categorize data when raw data is not 1,2,3 etc.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-categorize-data-when-raw-data-is-not-1-2-3-etc/m-p/679794#M205309</link>
      <description>&lt;P&gt;I figured it out!&amp;nbsp;&lt;/P&gt;&lt;P&gt;if 101&amp;lt;=alcday5&amp;lt;=199 then alcohol = 3;&lt;BR /&gt;if 201&amp;lt;=alcday5&amp;lt;=299 then alcohol = 2;&lt;BR /&gt;if alcday5 = 888 then alcohol = 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 16:15:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-categorize-data-when-raw-data-is-not-1-2-3-etc/m-p/679794#M205309</guid>
      <dc:creator>zahidhasandipu</dc:creator>
      <dc:date>2020-08-27T16:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to categorize data when raw data is not 1,2,3 etc.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-categorize-data-when-raw-data-is-not-1-2-3-etc/m-p/679795#M205310</link>
      <description>Yep, exactly! Thank you</description>
      <pubDate>Thu, 27 Aug 2020 16:15:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-categorize-data-when-raw-data-is-not-1-2-3-etc/m-p/679795#M205310</guid>
      <dc:creator>zahidhasandipu</dc:creator>
      <dc:date>2020-08-27T16:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to categorize data when raw data is not 1,2,3 etc.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-categorize-data-when-raw-data-is-not-1-2-3-etc/m-p/679798#M205312</link>
      <description>&lt;P&gt;And for the $64,000 question, WHAT interpretation is Alcohol=2? and Alcohol=3?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The question reads like an assignment so I won't argue with the coding but the use is a completely different matter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it is supposed to be a "severity" measure then you may want to consider which is more "severe" 1 drink per week (101) or 99 drinks per month (299)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the source is as I think, then wait until you try to reconcile the "drinks per occasion" with the other related variables.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 16:29:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-categorize-data-when-raw-data-is-not-1-2-3-etc/m-p/679798#M205312</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-08-27T16:29:44Z</dc:date>
    </item>
  </channel>
</rss>

