<?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: Changing Data-Type: (Numeric to Categorical) SAS Studio in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Changing-Data-Type-Numeric-to-Categorical-SAS-Studio/m-p/775036#M31287</link>
    <description>&lt;P&gt;You don't need to change the type of the variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Depending on which procedure you're using, you can include your variable in the CLASS statement and SAS will treat it as categorical variable. You can recode it to a character but it's unnecessary, categorical, nominal, or ordinal variables can be numeric or character in SAS.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ordinal logistic model example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic data=sashelp.cars;
class cylinders / param=ref;
model origin = cylinders;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/403431"&gt;@brush01&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm working with the MTCars data set in SAS Studio, and noticed the cylinder column is of numeric type. I feel that because the number of cylinders in a car is either 4, 6, or 8, a data-type of categorical would be more appropriate. (I have included a screenshot of my issue.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://prnt.sc/1woaj4u" target="_blank" rel="noopener"&gt;https://prnt.sc/1woaj4u&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I change a data-type when working with a data set?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Oct 2021 02:26:00 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-10-19T02:26:00Z</dc:date>
    <item>
      <title>Changing Data-Type: (Numeric to Categorical) SAS Studio</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Changing-Data-Type-Numeric-to-Categorical-SAS-Studio/m-p/775033#M31286</link>
      <description>&lt;P&gt;I'm working with the MTCars data set in SAS Studio, and noticed the cylinder column is of numeric type. I feel that because the number of cylinders in a car is either 4, 6, or 8, a data-type of categorical would be more appropriate. (I have included a screenshot of my issue.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://prnt.sc/1woaj4u" target="_blank"&gt;https://prnt.sc/1woaj4u&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I change a data-type when working with a data set?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 02:17:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Changing-Data-Type-Numeric-to-Categorical-SAS-Studio/m-p/775033#M31286</guid>
      <dc:creator>brush01</dc:creator>
      <dc:date>2021-10-19T02:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Data-Type: (Numeric to Categorical) SAS Studio</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Changing-Data-Type-Numeric-to-Categorical-SAS-Studio/m-p/775036#M31287</link>
      <description>&lt;P&gt;You don't need to change the type of the variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Depending on which procedure you're using, you can include your variable in the CLASS statement and SAS will treat it as categorical variable. You can recode it to a character but it's unnecessary, categorical, nominal, or ordinal variables can be numeric or character in SAS.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ordinal logistic model example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic data=sashelp.cars;
class cylinders / param=ref;
model origin = cylinders;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/403431"&gt;@brush01&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm working with the MTCars data set in SAS Studio, and noticed the cylinder column is of numeric type. I feel that because the number of cylinders in a car is either 4, 6, or 8, a data-type of categorical would be more appropriate. (I have included a screenshot of my issue.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://prnt.sc/1woaj4u" target="_blank" rel="noopener"&gt;https://prnt.sc/1woaj4u&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I change a data-type when working with a data set?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 02:26:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Changing-Data-Type-Numeric-to-Categorical-SAS-Studio/m-p/775036#M31287</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-10-19T02:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Data-Type: (Numeric to Categorical) SAS Studio</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Changing-Data-Type-Numeric-to-Categorical-SAS-Studio/m-p/775037#M31288</link>
      <description>If you do want to convert it, SAS requires it to be a new variable so something like below:&lt;BR /&gt;&lt;BR /&gt;data cars;&lt;BR /&gt;set sashelp.cars;&lt;BR /&gt;Cylinder_character = put(cylinders, 8. -l);&lt;BR /&gt;run;</description>
      <pubDate>Tue, 19 Oct 2021 02:28:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Changing-Data-Type-Numeric-to-Categorical-SAS-Studio/m-p/775037#M31288</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-10-19T02:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Data-Type: (Numeric to Categorical) SAS Studio</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Changing-Data-Type-Numeric-to-Categorical-SAS-Studio/m-p/775186#M31294</link>
      <description>&lt;P&gt;you can use if-else statements if you really want a categorical variable.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 17:33:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Changing-Data-Type-Numeric-to-Categorical-SAS-Studio/m-p/775186#M31294</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2021-10-19T17:33:22Z</dc:date>
    </item>
  </channel>
</rss>

