<?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 Use a categorical variable to split a numeric variables into intervals in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Use-a-categorical-variable-to-split-a-numeric-variables-into/m-p/313757#M68223</link>
    <description>&lt;P&gt;I would like to perform an ANOVA analysis with a blocking variable.&lt;/P&gt;&lt;P&gt;My dependent variable would be Intensity (interval)&lt;/P&gt;&lt;P&gt;My independent variable is Name (A1 through A16)&lt;/P&gt;&lt;P&gt;And my blocking variable would be mass (interval). In order to use mass as a blocking factor, I would have to transform it into a categorical variable. Basically, I would like to do something similar to an Interactive Grouping (EM) for Mass in Base SAS&amp;nbsp;depending on the values for Name.&lt;/P&gt;&lt;P&gt;I need to know which mass intervals are associated with which names.&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 23 Nov 2016 12:19:18 GMT</pubDate>
    <dc:creator>Elle</dc:creator>
    <dc:date>2016-11-23T12:19:18Z</dc:date>
    <item>
      <title>Use a categorical variable to split a numeric variables into intervals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-a-categorical-variable-to-split-a-numeric-variables-into/m-p/313757#M68223</link>
      <description>&lt;P&gt;I would like to perform an ANOVA analysis with a blocking variable.&lt;/P&gt;&lt;P&gt;My dependent variable would be Intensity (interval)&lt;/P&gt;&lt;P&gt;My independent variable is Name (A1 through A16)&lt;/P&gt;&lt;P&gt;And my blocking variable would be mass (interval). In order to use mass as a blocking factor, I would have to transform it into a categorical variable. Basically, I would like to do something similar to an Interactive Grouping (EM) for Mass in Base SAS&amp;nbsp;depending on the values for Name.&lt;/P&gt;&lt;P&gt;I need to know which mass intervals are associated with which names.&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 12:19:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-a-categorical-variable-to-split-a-numeric-variables-into/m-p/313757#M68223</guid>
      <dc:creator>Elle</dc:creator>
      <dc:date>2016-11-23T12:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: Use a categorical variable to split a numeric variables into intervals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-a-categorical-variable-to-split-a-numeric-variables-into/m-p/313805#M68239</link>
      <description>&lt;P&gt;You can create the categorical variable as in next demo:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc format lib=work;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; value &lt;STRONG&gt;ctagx&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; low - -10 = "LT -10" &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; -10 - &amp;nbsp;0 &amp;nbsp; = "-10 - 0"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; - 100 = "0 - 100"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 100 - high = " GT 100"&lt;/P&gt;
&lt;P&gt;; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can define your own ranges, as much as you need, and the labels (righ side) you prefer.&lt;/P&gt;
&lt;P&gt;The LOW - / - HIGH rows are optional.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After creating the format you need create your categories, as in:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt;category = put(num_var , catgx.);&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ... other code as needed ...&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 15:04:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-a-categorical-variable-to-split-a-numeric-variables-into/m-p/313805#M68239</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-11-23T15:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Use a categorical variable to split a numeric variables into intervals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-a-categorical-variable-to-split-a-numeric-variables-into/m-p/313809#M68241</link>
      <description>Hello, I appreciate you answering me, but this isn't what I'm looking for. Sure, I want to split Mass into ranges, but how do I determine those ranges? I want to split Mass in such a way that each mass range gets associated with each Name level. So, let's say Mass ranges from 1 to 1600. I want to be able to say mass1 (1 - 100) is associated with Name=A1, mass2 (201-300) is associated with Name=A2, and so on... that makes me think, maybe I could pull this off by using a decision tree, where Name is the target and Mass is the feature...</description>
      <pubDate>Wed, 23 Nov 2016 15:25:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-a-categorical-variable-to-split-a-numeric-variables-into/m-p/313809#M68241</guid>
      <dc:creator>Elle</dc:creator>
      <dc:date>2016-11-23T15:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: Use a categorical variable to split a numeric variables into intervals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-a-categorical-variable-to-split-a-numeric-variables-into/m-p/313813#M68243</link>
      <description>&lt;P&gt;I hope one of the next two fits to what you want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;either - assigning a name to a range:&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;proc format lib=work;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; value &lt;STRONG&gt;ctagx&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; low - -10 = "A1" &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; -10 - &amp;nbsp;0 &amp;nbsp; = "A2"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; - 100 = "A3"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 100 - high = "A4"&lt;/P&gt;
&lt;P&gt;; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;OR&lt;/STRONG&gt; - assigning a range to a name you already have:&lt;/P&gt;
&lt;P&gt;proc format lib=work;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; value &lt;STRONG&gt;ctagx&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; "A1"&amp;nbsp;= "LT -10" &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; "A2" &amp;nbsp;= "-10 - 0"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; "A3" = "0 - 100"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; "A4" = " GT 100"&lt;/P&gt;
&lt;P&gt;; run;&lt;/P&gt;
&lt;P&gt;in this last case change the code in the data step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;category = put(num_var , $catgx.);&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 15:38:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-a-categorical-variable-to-split-a-numeric-variables-into/m-p/313813#M68243</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-11-23T15:38:09Z</dc:date>
    </item>
  </channel>
</rss>

