<?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: Creation of categorical variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creation-of-categorical-variables/m-p/136337#M261139</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you didn't provide any &lt;STRONG&gt;example&lt;/STRONG&gt; of your dummy variables or data layout I had to guess. If multiples of your dummy variables are 'Yes' then you need to describe the rules for which result you want. If the dummy variables are coded 0/1 and ONLY one is set to yest the code will work as described. Incomplete descriptions=incomplete answers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Jul 2014 14:59:49 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2014-07-25T14:59:49Z</dc:date>
    <item>
      <title>Creation of categorical variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creation-of-categorical-variables/m-p/136332#M261134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible to take three dummy variables and recode them into one categorical variable with 4 different categories? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 20:10:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creation-of-categorical-variables/m-p/136332#M261134</guid>
      <dc:creator>Mdormond</dc:creator>
      <dc:date>2014-07-24T20:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: Creation of categorical variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creation-of-categorical-variables/m-p/136333#M261135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes.&lt;/P&gt;&lt;P&gt;Simple example is 3 variables coded 1 for yes (the dummy value of interest).&lt;/P&gt;&lt;P&gt;ina a data step&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;If var1=1 then Cat=1;&lt;/P&gt;&lt;P&gt;else if var2=1 then Cat=2;&lt;/P&gt;&lt;P&gt;else if var3=1 the cat=3;&lt;/P&gt;&lt;P&gt;else Cat=4;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 20:26:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creation-of-categorical-variables/m-p/136333#M261135</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-07-24T20:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Creation of categorical variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creation-of-categorical-variables/m-p/136334#M261136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From the above code, since we are using the same cat variable for categorizing the var1,var2,var3 data, the final output will show the cat=3. per the code everytime the if then else condition executes and if the var1,var2 and var3 values are same , the cat value will be replaced or overwritten with 1, 2 and 3. but the final output will show 3. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the above code will work only when the three variables will have different values per row. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;jag&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jul 2014 01:09:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creation-of-categorical-variables/m-p/136334#M261136</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2014-07-25T01:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Creation of categorical variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creation-of-categorical-variables/m-p/136335#M261137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there any way to code it so the final output does not show all 3's? I would like each category to display a unique value. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jul 2014 01:28:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creation-of-categorical-variables/m-p/136335#M261137</guid>
      <dc:creator>Mdormond</dc:creator>
      <dc:date>2014-07-25T01:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: Creation of categorical variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creation-of-categorical-variables/m-p/136336#M261138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;cat = whichn(1, var1, var2, var3);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jul 2014 02:23:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creation-of-categorical-variables/m-p/136336#M261138</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-07-25T02:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: Creation of categorical variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creation-of-categorical-variables/m-p/136337#M261139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you didn't provide any &lt;STRONG&gt;example&lt;/STRONG&gt; of your dummy variables or data layout I had to guess. If multiples of your dummy variables are 'Yes' then you need to describe the rules for which result you want. If the dummy variables are coded 0/1 and ONLY one is set to yest the code will work as described. Incomplete descriptions=incomplete answers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jul 2014 14:59:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creation-of-categorical-variables/m-p/136337#M261139</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-07-25T14:59:49Z</dc:date>
    </item>
  </channel>
</rss>

